Class: RespondableTelegram
- Defined in:
- lib/telegrams/respondable_telegram.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Attributes inherited from Telegram
Instance Method Summary collapse
-
#as_bytes ⇒ Object
override.
-
#initialize(require_response = true) ⇒ RespondableTelegram
constructor
A new instance of RespondableTelegram.
- #require_response=(value) ⇒ Object
- #require_response? ⇒ Boolean
Methods inherited from Telegram
Constructor Details
#initialize(require_response = true) ⇒ RespondableTelegram
Returns a new instance of RespondableTelegram.
5 6 7 8 |
# File 'lib/telegrams/respondable_telegram.rb', line 5 def initialize(require_response=true) @require_response = require_response @command = nil end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/telegrams/respondable_telegram.rb', line 4 def command @command end |
Instance Method Details
#as_bytes ⇒ Object
override
19 20 21 |
# File 'lib/telegrams/respondable_telegram.rb', line 19 def as_bytes [adjust_type_for_require_response, command] end |
#require_response=(value) ⇒ Object
14 15 16 |
# File 'lib/telegrams/respondable_telegram.rb', line 14 def require_response=(value) @require_response = value end |
#require_response? ⇒ Boolean
10 11 12 |
# File 'lib/telegrams/respondable_telegram.rb', line 10 def require_response? @require_response end |