Class: Tinybucket::Api::Parser
- Inherits:
-
Object
- Object
- Tinybucket::Api::Parser
- Defined in:
- lib/tinybucket/api/base_api.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, model_class) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(type, model_class) ⇒ Parser
Returns a new instance of Parser.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tinybucket/api/base_api.rb', line 8 def initialize(type, model_class) parser_class = case type when :collection then Tinybucket::Parser::CollectionParser when :object then Tinybucket::Parser::ObjectParser else throw "Unknown parser type: #{type}" end @type = parser_class @options = { model_class: model_class } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/tinybucket/api/base_api.rb', line 6 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/tinybucket/api/base_api.rb', line 6 def type @type end |