Method: FortyTwo::Response::Base#initialize
- Defined in:
- lib/fortytwo/responses/base.rb
#initialize(json) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 14 |
# File 'lib/fortytwo/responses/base.rb', line 6 def initialize(json) return if json.nil? return instance_variable_set(instance_variable_name, json) if json.is_a?(Array) json.each do |key, value| key = key.chomp('?') if key.end_with?('?') instance_variable_set("@#{key}", value) end end |