Class: Camdram::Performance

Inherits:
Base
  • Object
show all
Defined in:
lib/camdram/performance.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::Performance

Instantiate a new Performance object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


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

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?
  @venue = Venue.new(@venue, @client_instance) unless @venue.nil?
end

Instance Attribute Details

#other_venueObject

Returns the value of attribute other_venue


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

def other_venue
  @other_venue
end

#repeat_untilObject

Returns the value of attribute repeat_until


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

def repeat_until
  @repeat_until
end

#start_atObject

Returns the value of attribute start_at


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

def start_at
  @start_at
end

#venueObject

Returns the value of attribute venue


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

def venue
  @venue
end

Instance Method Details

#infoHash

Return a hash of the performance's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


25
26
27
28
29
30
31
32
# File 'lib/camdram/performance.rb', line 25

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