Class: Camdram::Audition

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

Instantiate a new Audition object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


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

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

Instance Attribute Details

#end_atObject

Returns the value of attribute end_at


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

def end_at
  @end_at
end

#locationObject

Returns the value of attribute location


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

def location
  @location
end

#showObject

Returns the value of attribute show


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

def show
  @show
end

#start_atObject

Returns the value of attribute start_at


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

def start_at
  @start_at
end

Instance Method Details

#infoHash

Return a hash of the audition's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


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

def info
  {
    id: id,
    start_at: start_at,
    end_at: end_at,
    location: location,
    show: show,
  }
end