Class: Sorenson::Services::Event
- Defined in:
- lib/sorenson/services/event.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#date ⇒ Object
Returns the value of attribute date.
-
#day ⇒ Object
Returns the value of attribute day.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#retreived_on ⇒ Object
Returns the value of attribute retreived_on.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
Methods inherited from Base
delete_from, get_from, host, login_no_resource, parse_response, post_to, put_to, verify_account_settings
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sorenson/services/event.rb', line 5 def initialize(data) @date = Date.parse(data['eventDate']) @day = Date.parse(data['eventDay']) @last_modified = Date.parse(data['dateLastModified']) @retreived_on = Date.parse(data['dateRetrieved']) @id = data['id'] @account_id = data['accountId'] @value = data['eventIntegerValue'] || data['eventDecimalValue'] || data['eventStringValue'] @type = data['eventType'] # {"eventDate"=>"2009-12-17 20:31:40", # "accountId"=>"db786013-c786-4511-8a0d-73f1bacc2285", # "eventIntegerValue"=>292684, # "eventType"=>"storageAdd", # "eventDay"=>"2009-12-17", # "eventDecimalValue"=>nil, # "id"=>"80437d46-f704-4fbc-8e61-0e9467a60b05", # "dateLastModified"=>"2009-12-17 20:31:40", # "eventStringValue"=>nil, # "dateRetrieved"=>"2009-12-30 13:16:18"} end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def account_id @account_id end |
#date ⇒ Object
Returns the value of attribute date.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def date @date end |
#day ⇒ Object
Returns the value of attribute day.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def day @day end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def id @id end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def last_modified @last_modified end |
#retreived_on ⇒ Object
Returns the value of attribute retreived_on.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def retreived_on @retreived_on end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/sorenson/services/event.rb', line 4 def value @value end |