Class: Camdram::Performance

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

Instance Attribute Summary collapse

Attributes included from API

#http

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods included from API

#update!

Constructor Details

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

Instantiate a new Performance object from a JSON hash

Parameters:

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

    A single JSON hash with symbolized keys.



14
15
16
17
# File 'lib/camdram/performance.rb', line 14

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

Instance Attribute Details

#end_dateObject

Returns the value of attribute end_date.



8
9
10
# File 'lib/camdram/performance.rb', line 8

def end_date
  @end_date
end

#other_venueObject

Returns the value of attribute other_venue.



8
9
10
# File 'lib/camdram/performance.rb', line 8

def other_venue
  @other_venue
end

#start_dateObject

Returns the value of attribute start_date.



8
9
10
# File 'lib/camdram/performance.rb', line 8

def start_date
  @start_date
end

#timeObject

Returns the value of attribute time.



8
9
10
# File 'lib/camdram/performance.rb', line 8

def time
  @time
end

#venueObject

Returns the value of attribute venue.



8
9
10
# File 'lib/camdram/performance.rb', line 8

def venue
  @venue
end

Instance Method Details

#infoHash

Return a hash of the performance's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



22
23
24
25
26
27
28
29
# File 'lib/camdram/performance.rb', line 22

def info
  {
    start_date: start_date,
    end_date: end_date,
    time: time,
    other_venue: other_venue,
  }
end