Class: Gsm::Incoming
- Inherits:
-
Object
- Object
- Gsm::Incoming
- Defined in:
- lib/rubygsm/msg/incoming.rb
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#received ⇒ Object
readonly
Returns the value of attribute received.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#sent ⇒ Object
readonly
Returns the value of attribute sent.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(device, sender, sent, text) ⇒ Incoming
constructor
A new instance of Incoming.
-
#number ⇒ Object
Returns the sender of this message, so incoming and outgoing messages can be logged in the same way.
Constructor Details
#initialize(device, sender, sent, text) ⇒ Incoming
Returns a new instance of Incoming.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubygsm/msg/incoming.rb', line 8 def initialize(device, sender, sent, text) # move all arguments into read-only # attributes. ugly, but Struct only # supports read/write attrs @device = device @sender = sender @sent = sent @text = text # assume that the message was # received right now, since we # don't have an incoming buffer @received = Time.now end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
6 7 8 |
# File 'lib/rubygsm/msg/incoming.rb', line 6 def device @device end |
#received ⇒ Object (readonly)
Returns the value of attribute received.
6 7 8 |
# File 'lib/rubygsm/msg/incoming.rb', line 6 def received @received end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
6 7 8 |
# File 'lib/rubygsm/msg/incoming.rb', line 6 def sender @sender end |
#sent ⇒ Object (readonly)
Returns the value of attribute sent.
6 7 8 |
# File 'lib/rubygsm/msg/incoming.rb', line 6 def sent @sent end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/rubygsm/msg/incoming.rb', line 6 def text @text end |
Instance Method Details
#number ⇒ Object
Returns the sender of this message, so incoming and outgoing messages can be logged in the same way.
27 28 29 |
# File 'lib/rubygsm/msg/incoming.rb', line 27 def number sender end |