Class: ACTV::SubEvent
- Inherits:
-
Object
- Object
- ACTV::SubEvent
- Defined in:
- lib/actv/sub_event.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(hsh) ⇒ SubEvent
constructor
A new instance of SubEvent.
Constructor Details
#initialize(hsh) ⇒ SubEvent
Returns a new instance of SubEvent.
5 6 7 8 9 10 11 12 |
# File 'lib/actv/sub_event.rb', line 5 def initialize hsh @id = hsh[:assetGuid] @name = hsh[:assetName] @start_date = Time.parse(hsh.fetch(:activityStartDate, "1970-01-01T00:00:00")) @end_date = Time.parse(hsh.fetch(:activityEndDate, "1970-01-01T00:00:00")) url = hsh.fetch(:assetSeoUrls, []).first || {} @url = url.fetch :urlAdr, "http://www.active.com/asset_service/#{@id}" end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
3 4 5 |
# File 'lib/actv/sub_event.rb', line 3 def end_date @end_date end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/actv/sub_event.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/actv/sub_event.rb', line 3 def name @name end |
#start_date ⇒ Object
Returns the value of attribute start_date.
3 4 5 |
# File 'lib/actv/sub_event.rb', line 3 def start_date @start_date end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/actv/sub_event.rb', line 3 def url @url end |