Class: Bvr::Call
- Inherits:
-
Object
- Object
- Bvr::Call
- Defined in:
- lib/bvr/call.rb
Instance Attribute Summary collapse
-
#calltype ⇒ Object
Returns the value of attribute calltype.
-
#charge ⇒ Object
Returns the value of attribute charge.
-
#id ⇒ Object
Returns the value of attribute id.
-
#raw_dest ⇒ Object
Returns the value of attribute raw_dest.
-
#raw_duration ⇒ Object
Returns the value of attribute raw_duration.
-
#raw_start_time ⇒ Object
Returns the value of attribute raw_start_time.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#calltype ⇒ Object
Returns the value of attribute calltype.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def calltype @calltype end |
#charge ⇒ Object
Returns the value of attribute charge.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def charge @charge end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def id @id end |
#raw_dest ⇒ Object
Returns the value of attribute raw_dest.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def raw_dest @raw_dest end |
#raw_duration ⇒ Object
Returns the value of attribute raw_duration.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def raw_duration @raw_duration end |
#raw_start_time ⇒ Object
Returns the value of attribute raw_start_time.
3 4 5 |
# File 'lib/bvr/call.rb', line 3 def raw_start_time @raw_start_time end |
Class Method Details
.new_from_response(h) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/bvr/call.rb', line 5 def self.new_from_response(h) self.new.tap do |call| call.id = h['CallId'] call.calltype = h['CallType'] call.raw_start_time = h['StartTime'] call.raw_dest = h['Destination'] call.raw_duration = h['Duration'] call.charge = h['Charge'] end end |
Instance Method Details
#dest ⇒ Object
20 21 22 |
# File 'lib/bvr/call.rb', line 20 def dest @_dest ||= Bvr::Phone.new(self.raw_dest) end |
#duration ⇒ Object
16 17 18 |
# File 'lib/bvr/call.rb', line 16 def duration @_duration ||= Time.parse(self.raw_duration, self.start_time) end |
#start_time ⇒ Object
24 25 26 |
# File 'lib/bvr/call.rb', line 24 def start_time @_start_time ||= Time.parse(self.raw_start_time) end |