Class: Pandoru::Models::SearchResultItem
- Inherits:
-
Base
- Object
- Base
- Pandoru::Models::SearchResultItem
show all
- Defined in:
- lib/pandoru/models/search.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
date_field, field, fields, from_json, from_json_list, #initialize, #inspect, #populate_from_json, #to_h
Instance Method Details
#artist? ⇒ Boolean
16
17
18
|
# File 'lib/pandoru/models/search.rb', line 16
def artist?
song_name.nil?
end
|
#create_station ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/pandoru/models/search.rb', line 20
def create_station
return nil unless @api_client
if song?
@api_client.create_station(song_token: music_token)
else
@api_client.create_station(artist_token: music_token)
end
end
|
#song? ⇒ Boolean
12
13
14
|
# File 'lib/pandoru/models/search.rb', line 12
def song?
!song_name.nil?
end
|