Method: Tinybucket::Api::Parser#initialize
- Defined in:
- lib/tinybucket/api/base_api.rb
#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 |