Class: Pandoru::Models::StationSeeds
- Defined in:
- lib/pandoru/models/station.rb
Overview
The seed sets for a station, grouped by kind.
Instance Attribute Summary collapse
-
#artists ⇒ Object
Returns the value of attribute artists.
-
#genres ⇒ Object
Returns the value of attribute genres.
-
#songs ⇒ Object
Returns the value of attribute songs.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#all ⇒ Object
All seeds flattened into one array.
Methods inherited from Base
date_field, field, fields, from_json_list, #initialize, #inspect, #populate_from_json, #to_h
Constructor Details
This class inherits a constructor from Pandoru::Models::Base
Instance Attribute Details
#artists ⇒ Object
Returns the value of attribute artists.
39 40 41 |
# File 'lib/pandoru/models/station.rb', line 39 def artists @artists end |
#genres ⇒ Object
Returns the value of attribute genres.
39 40 41 |
# File 'lib/pandoru/models/station.rb', line 39 def genres @genres end |
#songs ⇒ Object
Returns the value of attribute songs.
39 40 41 |
# File 'lib/pandoru/models/station.rb', line 39 def songs @songs end |
Class Method Details
.from_json(api_client, data) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/pandoru/models/station.rb', line 41 def self.from_json(api_client, data) return nil unless data instance = new(data, api_client) instance.genres = StationSeed.from_json_list(api_client, data['genres']) instance.songs = StationSeed.from_json_list(api_client, data['songs']) instance.artists = StationSeed.from_json_list(api_client, data['artists']) instance end |
Instance Method Details
#all ⇒ Object
All seeds flattened into one array.
51 52 53 |
# File 'lib/pandoru/models/station.rb', line 51 def all Array(genres) + Array(artists) + Array(songs) end |