Class: Howkast::Processor::Users

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

Class Method Summary collapse

Methods inherited from Base

path

Class Method Details

.default_for(field) ⇒ Object



43
44
45
# File 'lib/howkast/processors/users.rb', line 43

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

.filter(args, options) ⇒ Object



26
27
28
29
30
31
# File 'lib/howkast/processors/users.rb', line 26

def filter args, options
  args << options.delete(:id)
  args << :profile
  args << Array(options.delete(:resource))
  args.compact!
end

.parse_element(data) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/howkast/processors/users.rb', line 33

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