Class: TicketflyPlus::Responses::Events

Inherits:
Base
  • Object
show all
Defined in:
lib/ticketfly_plus/responses.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#link, #maxResults, #pageNum, #status, #title, #totalPages, #totalResults

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Events

Returns a new instance of Events.



36
37
38
39
40
# File 'lib/ticketfly_plus/responses.rb', line 36

def initialize(response)
    super
    @events = !check_nil(response['events']).nil? ? get_events(response['events']) : response['events']
    @org = !response['org'].nil? ? TicketflyPlus::Objects::Org.new(response['org']) : response['org']
end

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



33
34
35
# File 'lib/ticketfly_plus/responses.rb', line 33

def events
  @events
end

#orgObject

Returns the value of attribute org.



34
35
36
# File 'lib/ticketfly_plus/responses.rb', line 34

def org
  @org
end

Instance Method Details

#get_events(events) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/ticketfly_plus/responses.rb', line 42

def get_events(events)
    arr = Array.new
    if events.length > 0
        events.each do |event|
            arr.push TicketflyPlus::Objects::Event.new(event)
        end
    end
    arr
end