Class: Camdram::Event

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

Instance Attribute Summary collapse

Attributes included from API

#http

Instance Method Summary collapse

Methods included from API

#update!

Constructor Details

#initialize(options = {}) ⇒ Camdram::Event

Instantiate a new Event object from a JSON hash

Parameters:

  • options (Hash) (defaults to: {})

    A single JSON hash with symbolized keys.



15
16
17
18
19
# File 'lib/camdram/event.rb', line 15

def initialize(options = {})
  super(options)
  @show = Show.new( @show ) unless @show.nil?
  @venue = Venue.new( @venue ) unless @venue.nil?
end

Instance Attribute Details

#end_dateObject

Returns the value of attribute end_date.



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

def end_date
  @end_date
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#other_venueObject

Returns the value of attribute other_venue.



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

def other_venue
  @other_venue
end

#showObject

Returns the value of attribute show.



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

def show
  @show
end

#start_dateObject

Returns the value of attribute start_date.



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

def start_date
  @start_date
end

#timeObject

Returns the value of attribute time.



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

def time
  @time
end

#venueObject

Returns the value of attribute venue.



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

def venue
  @venue
end

Instance Method Details

#infoHash

Return a hash of the image's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/camdram/event.rb', line 24

def info
  {
    id: id,
    start_date: start_date,
    end_date: end_date,
    time: time,
    other_venue: other_venue,
    show: show,
    venue: venue,
  }
end