Class: Howkast::Processor::Videos
- Defined in:
- lib/howkast/processors/videos.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.default_for(field) ⇒ Object
68 69 70 |
# File 'lib/howkast/processors/videos.rb', line 68 def default_for field [] if %w{ category_hierarchy ingredients markers related_videos }.include? field end |
.filter(args, options) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/howkast/processors/videos.rb', line 48 def filter args, args << .delete(:id) args << .delete(:sort) args << .delete(:filter) args << .delete(:category) args << .delete(:page) args.compact! end |
.parse_element(data) ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/howkast/processors/videos.rb', line 57 def parse_element data = ->(key, value){ key, value } if data.has_key? 'video' data = data['video'] klass = Howkast::Model.synthesize('Video', data) klass.new self, data, & else parse_list 'video', data['videos'], & end end |