Class: SimpleEventickApi::Event
- Defined in:
- lib/simple_eventick_api/event.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#attendees ⇒ Object
readonly
Returns the value of attribute attendees.
-
#id ⇒ Object
Returns the value of attribute id.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#start_at ⇒ Object
Returns the value of attribute start_at.
-
#tickets ⇒ Object
Returns the value of attribute tickets.
-
#title ⇒ Object
Returns the value of attribute title.
-
#venue ⇒ Object
Returns the value of attribute venue.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Event
constructor
constructors.
Methods inherited from Base
Constructor Details
#initialize(args = {}) ⇒ Event
constructors
11 12 13 14 15 16 17 18 19 |
# File 'lib/simple_eventick_api/event.rb', line 11 def initialize(args={}) links = args.delete('links') args.each do |key, value| self.public_send("#{key}=", value) end # self.tickets = links['tickets'].map { |o| Ticket.new(o) } if links end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
8 9 10 |
# File 'lib/simple_eventick_api/event.rb', line 8 def all @all end |
#attendees ⇒ Object (readonly)
Returns the value of attribute attendees.
8 9 10 |
# File 'lib/simple_eventick_api/event.rb', line 8 def attendees @attendees end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def id @id end |
#slug ⇒ Object
Returns the value of attribute slug.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def slug @slug end |
#start_at ⇒ Object
Returns the value of attribute start_at.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def start_at @start_at end |
#tickets ⇒ Object
Returns the value of attribute tickets.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def tickets @tickets end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def title @title end |
#venue ⇒ Object
Returns the value of attribute venue.
7 8 9 |
# File 'lib/simple_eventick_api/event.rb', line 7 def venue @venue end |
Class Method Details
.all(token) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/simple_eventick_api/event.rb', line 21 def self.all (token) response = get(token) events = Array.new response['events'].map { |r| e = self.new (r) events << e } events end |
.find(token, event_id) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/simple_eventick_api/event.rb', line 33 def self.find (token, event_id) resource "events/#{event_id}" response = get(token) events = Array.new r = response['events'].first self.new (r) end |