Class: Howkast::Processor::Base
- Inherits:
-
Object
- Object
- Howkast::Processor::Base
- Defined in:
- lib/howkast/processors/base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.default_for(field) ⇒ Object
Override to provide a value for field when field is nil.
-
.filter(args, options) ⇒ Object
Override to massage args and options as needed.
-
.parse_element(data) ⇒ Object
Override to process data and restructure the returned value (eg: parse data and return a Howkast::Model::Video instance).
-
.path ⇒ Object
The name of the processor dictates the path used to communicate to the API server.
Class Method Details
.default_for(field) ⇒ Object
Override to provide a value for field when field is nil.
13 |
# File 'lib/howkast/processors/base.rb', line 13 def default_for field; end |
.filter(args, options) ⇒ Object
Override to massage args and options as needed.
16 |
# File 'lib/howkast/processors/base.rb', line 16 def filter args, ; end |
.parse_element(data) ⇒ Object
Override to process data and restructure the returned value (eg: parse data and return a Howkast::Model::Video instance). By default it simply returns data in its ‘raw’ form (the Hash from HTTParty’s parsed response)
22 23 24 |
# File 'lib/howkast/processors/base.rb', line 22 def parse_element data data end |
.path ⇒ Object
The name of the processor dictates the path used to communicate to the API server. override to provide an alternate path.
8 9 10 |
# File 'lib/howkast/processors/base.rb', line 8 def path "#{self}".split('::').last.downcase unless "#{self}" =~ /::Base$/u end |