Class: Hooloo::Genre
- Inherits:
-
MozartHash
- Object
- MozartHash
- Hooloo::Genre
- Defined in:
- lib/hooloo/genre.rb
Class Method Summary collapse
-
.list(args = {}) ⇒ Array<Hooloo::Genre>
List all genres known to Hulu.
Instance Method Summary collapse
-
#initialize(obj) ⇒ Genre
constructor
A new instance of Genre.
-
#shows(args = {}) ⇒ Enumerator<Hooloo::Show>
List all shows in this genre.
Methods inherited from MozartHash
bool, cast, date, field_mapping, float, #inspect, #method_missing, #respond_to?, uri
Constructor Details
#initialize(obj) ⇒ Genre
Returns a new instance of Genre.
2 3 4 5 6 7 8 9 |
# File 'lib/hooloo/genre.rb', line 2 def initialize(obj) super if obj.is_a? String @obj = {'canonical_name' => obj} else @obj = obj end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Hooloo::MozartHash
Class Method Details
Instance Method Details
#shows(args = {}) ⇒ Enumerator<Hooloo::Show>
List all shows in this genre
14 15 16 17 18 19 |
# File 'lib/hooloo/genre.rb', line 14 def shows(args={}) Hooloo.paginated_request('shows', { genre: canonical_name, sort: 'release_with_popularity' }.merge(args), 80) { |g, x| g << Hooloo::Show.new(x['show']) } end |