class ACTV::SubEvent

Attributes

end_date[RW]
id[RW]
name[RW]
start_date[RW]
url[RW]

Public Class Methods

new(hsh) click to toggle source
# 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