Class: ShakeTheCounter::Performance
- Inherits:
-
Object
- Object
- ShakeTheCounter::Performance
- Defined in:
- lib/shake_the_counter/performance.rb
Overview
Sets up a performance object
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#event ⇒ Object
Returns the value of attribute event.
-
#external_performance_id ⇒ Object
Returns the value of attribute external_performance_id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Instance Method Summary collapse
-
#initialize(args = {}, event: nil) ⇒ Performance
constructor
Sets up a new event.
-
#sections ⇒ Object
GET /api/v1/event/eventKey/performance/performanceKey/sections/languageCode Get available sections, pricetypes and prices of the selected performance.
Constructor Details
#initialize(args = {}, event: nil) ⇒ Performance
Sets up a new event
15 16 17 18 19 20 21 22 |
# File 'lib/shake_the_counter/performance.rb', line 15 def initialize(args={}, event: nil) self.key = args["PerformanceKey"] self.name = args["PerformanceName"] self.description = args["PerformanceDescription"] self.external_performance_id = args["ExternalPerformanceID"] self.raw_data = args self.event = event end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/shake_the_counter/performance.rb', line 8 def description @description end |
#event ⇒ Object
Returns the value of attribute event.
11 12 13 |
# File 'lib/shake_the_counter/performance.rb', line 11 def event @event end |
#external_performance_id ⇒ Object
Returns the value of attribute external_performance_id.
9 10 11 |
# File 'lib/shake_the_counter/performance.rb', line 9 def external_performance_id @external_performance_id end |
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/shake_the_counter/performance.rb', line 6 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/shake_the_counter/performance.rb', line 7 def name @name end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
10 11 12 |
# File 'lib/shake_the_counter/performance.rb', line 10 def raw_data @raw_data end |
Instance Method Details
#sections ⇒ Object
GET /api/v1/event/eventKey/performance/performanceKey/sections/languageCode Get available sections, pricetypes and prices of the selected performance
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/shake_the_counter/performance.rb', line 29 def sections return @sections if @sections @sections = [] path = "event/#{event.key}/performance/#{key}/sections/#{event.client.language_code}" result = event.client.call(path, http_method: :get) for section in result @sections << ShakeTheCounter::Section.new(section, performance: self) end return @sections end |