Skip to content

Instantly share code, notes, and snippets.

@AnthonyDGreen
Last active February 3, 2019 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnthonyDGreen/57ce7962700c5498894ad417296f9066 to your computer and use it in GitHub Desktop.
Save AnthonyDGreen/57ce7962700c5498894ad417296f9066 to your computer and use it in GitHub Desktop.
Class Alarm
Private ReadOnly Code As Integer
ReadOnly Property Status As String = "Disarmed"
Sub New(code As Integer)
Me.Code = code
End Sub
Sub Arm()
' I'm motifying the value of this externally read-only property here.
_Status = "Armed"
End Sub
Function Disarm(code As Integer) As Boolean
If code = Me.Code Then
' And here.
_Status = "Disarmed"
Return True
Else
Return False
End If
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment