Class: Camdram::Event

Inherits:
Base
  • Object
show all
Defined in:
lib/camdram/event.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Base

#make_orphan

Constructor Details

#initialize(*args) ⇒ Camdram::Event

Instantiate a new Event object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


16
17
18
19
20
21
22
# File 'lib/camdram/event.rb', line 16

def initialize(*args)
  super(*args)
  @start_at = DateTime.parse(@start_at) unless @start_at.nil?
  @repeat_until = Date.parse(@repeat_until) unless @repeat_until.nil?
  @show = Show.new(@show, @client_instance) unless @show.nil?
  @venue = Venue.new(@venue, @client_instance) unless @venue.nil?
end

Instance Attribute Details

#other_venueObject

Returns the value of attribute other_venue


10
11
12
# File 'lib/camdram/event.rb', line 10

def other_venue
  @other_venue
end

#repeat_untilObject

Returns the value of attribute repeat_until


10
11
12
# File 'lib/camdram/event.rb', line 10

def repeat_until
  @repeat_until
end

#showObject

Returns the value of attribute show


10
11
12
# File 'lib/camdram/event.rb', line 10

def show
  @show
end

#start_atObject

Returns the value of attribute start_at


10
11
12
# File 'lib/camdram/event.rb', line 10

def start_at
  @start_at
end

#venueObject

Returns the value of attribute venue


10
11
12
# File 'lib/camdram/event.rb', line 10

def venue
  @venue
end

Instance Method Details

#infoHash

Return a hash of the event's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


27
28
29
30
31
32
33
34
35
36
# File 'lib/camdram/event.rb', line 27

def info
  {
    id: id,
    start_at: start_at,
    repeat_until: repeat_until,
    other_venue: other_venue,
    show: show,
    venue: venue,
  }
end