Class: Pandoru::Models::StationSeed
- Defined in:
- lib/pandoru/models/station.rb
Overview
A single station seed — an artist, song, or genre the station was built from. Returned under the “music” key of a getStation response when includeExtendedAttributes is set.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #artist? ⇒ Boolean
- #genre? ⇒ Boolean
-
#label ⇒ Object
Human-readable label, handy for clustering/debugging.
- #song? ⇒ Boolean
Methods inherited from Base
date_field, field, fields, from_json, from_json_list, #initialize, #inspect, #populate_from_json, #to_h
Constructor Details
This class inherits a constructor from Pandoru::Models::Base
Instance Method Details
#artist? ⇒ Boolean
22 23 24 |
# File 'lib/pandoru/models/station.rb', line 22 def artist? song_name.nil? && !artist_name.nil? end |
#genre? ⇒ Boolean
26 27 28 |
# File 'lib/pandoru/models/station.rb', line 26 def genre? !genre_name.nil? end |
#label ⇒ Object
Human-readable label, handy for clustering/debugging.
31 32 33 34 |
# File 'lib/pandoru/models/station.rb', line 31 def label return genre_name if genre? [artist_name, song_name].compact.join(' - ') end |
#song? ⇒ Boolean
18 19 20 |
# File 'lib/pandoru/models/station.rb', line 18 def song? !song_name.nil? end |