Class: Ticketmaster::Classification
- Inherits:
-
Result
- Object
- Result
- Ticketmaster::Classification
show all
- Defined in:
- lib/ticketmaster/results/classification.rb
Instance Attribute Summary
Attributes inherited from Result
#data, #request
Instance Method Summary
collapse
Methods inherited from Result
array, create, #initialize, search
Instance Method Details
#genres ⇒ Object
11
12
13
|
# File 'lib/ticketmaster/results/classification.rb', line 11
def genres
Result.array(data['segment']['_embedded']['genres'], request, 'Ticketmaster::Classification') if data['segment']['_embedded']['genres']
end
|
#id ⇒ Object
3
4
5
|
# File 'lib/ticketmaster/results/classification.rb', line 3
def id
data['id'] || data['segment']['id']
end
|
#name ⇒ Object
7
8
9
|
# File 'lib/ticketmaster/results/classification.rb', line 7
def name
data['name'] || data['segment']['name']
end
|
#reload ⇒ Object
23
24
25
26
|
# File 'lib/ticketmaster/results/classification.rb', line 23
def reload
data = request.client.get_classification(id, type).data
self
end
|
#subgenres ⇒ Object
15
16
17
|
# File 'lib/ticketmaster/results/classification.rb', line 15
def subgenres
Result.array(data['segment']['_embedded']['subgenres'], request, 'Ticketmaster::Classification') if data['segment']['_embedded']['subgenres']
end
|
#type ⇒ Object
19
20
21
|
# File 'lib/ticketmaster/results/classification.rb', line 19
def type
data['_links']['self']['href'].match(/(?<=\/discovery\/v\d\/)[a-z\/]+(?=\/)/)[0]
end
|