Class: Howkast::Processor::Categories
- Defined in:
- lib/howkast/processors/categories.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.default_for(field) ⇒ Object
31 32 33 |
# File 'lib/howkast/processors/categories.rb', line 31 def default_for field [] if %w{ parents categories subcategories }.include? field end |
.filter(args, options) ⇒ Object
14 15 16 17 18 |
# File 'lib/howkast/processors/categories.rb', line 14 def filter args, args << .delete(:id) args.compact! = { } end |
.parse_element(data) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/howkast/processors/categories.rb', line 20 def parse_element data = ->(key, value){ key, value } if data.has_key? 'category' data = data['category'] klass = Howkast::Model.synthesize('Category', data) klass.new self, data, & else parse_list 'category', data['categories'], & end end |