Class: Howkast::Processor::Playlists

Inherits:
Base
  • Object
show all
Defined in:
lib/howkast/processors/playlists.rb

Class Method Summary collapse

Methods inherited from Base

path

Class Method Details

.default_for(field) ⇒ Object



36
37
38
# File 'lib/howkast/processors/playlists.rb', line 36

def default_for field
  [] if %w{ playlists videos }.include? field
end

.filter(args, options) ⇒ Object



20
21
22
23
24
# File 'lib/howkast/processors/playlists.rb', line 20

def filter args, options
  args << options.delete(:id)
  args.compact!
  options = { }
end

.parse_element(data) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/howkast/processors/playlists.rb', line 26

def parse_element data
  expander = ->(key, value){ expand key, value }
  if data.has_key? 'playlists'
    parse_list 'playlist', data['playlists'], &expander
  else
    klass = Howkast::Model.synthesize('Playlist', data)
    klass.new self, data, &expander
  end
end