Module: BMF::Message
- Defined in:
- lib/bmf/lib/message.rb
Class Method Summary collapse
Class Method Details
.received?(m) ⇒ Boolean
12 13 14 |
# File 'lib/bmf/lib/message.rb', line 12 def self.received?(m) !m['receivedTime'].nil? end |
.sent?(m) ⇒ Boolean
8 9 10 |
# File 'lib/bmf/lib/message.rb', line 8 def self.sent?(m) !m['lastActionTime'].nil? end |
.sent_or_received(m) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/bmf/lib/message.rb', line 16 def self.sent_or_received m if sent?(m) :sent elsif received?(m) :received else raise "Don't know if #{m.inspect} was sent or received" end end |
.time(m) ⇒ Object
2 3 4 5 6 |
# File 'lib/bmf/lib/message.rb', line 2 def self.time(m) time = m['receivedTime'] time = m['lastActionTime'] if time.nil? time.to_i end |