Class: RMeetup::Type::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/rmeetup/type/event.rb

Overview

RMeetup::Type::Event

Data wraper for a Event fethcing response Used to access result attributes as well as progammatically fetch relative data types based on this event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event = {}) ⇒ Event

Returns a new instance of Event.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rmeetup/type/event.rb', line 14

def initialize(event = {})
  self.id           = event['id'].to_i
  self.name         = event['name']
  self.updated      = DateTime.parse(event['updated'])
  self.time         = DateTime.parse(event['time'])
  self.photo_url    = event['photo_url']
  self.lat          = event['lat'].to_f
  self.lon          = event['lon'].to_f
  self.event_url    = event['event_url']
  self.rsvpcount    = event['rsvpcount'].to_i
  self.fee          = event['fee']
  self.feecurrency  = event['feecurrency']
  self.feedesc      = event['feedesc']
end

Instance Attribute Details

#event_urlObject

Returns the value of attribute event_url.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def event_url
  @event_url
end

#feeObject

Returns the value of attribute fee.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def fee
  @fee
end

#feecurrencyObject

Returns the value of attribute feecurrency.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def feecurrency
  @feecurrency
end

#feedescObject

Returns the value of attribute feedesc.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def feedesc
  @feedesc
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def id
  @id
end

#latObject

Returns the value of attribute lat.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def lat
  @lat
end

#lonObject

Returns the value of attribute lon.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def lon
  @lon
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def name
  @name
end

#photo_urlObject

Returns the value of attribute photo_url.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def photo_url
  @photo_url
end

#rsvpcountObject

Returns the value of attribute rsvpcount.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def rsvpcount
  @rsvpcount
end

#timeObject

Returns the value of attribute time.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def time
  @time
end

#updatedObject

Returns the value of attribute updated.



11
12
13
# File 'lib/rmeetup/type/event.rb', line 11

def updated
  @updated
end