Class: ClarifaiRuby::InfoResponse
- Inherits:
-
Object
- Object
- ClarifaiRuby::InfoResponse
- Defined in:
- lib/clarifai_ruby/info_response.rb
Instance Method Summary collapse
-
#initialize(json_response, recursion = 0) ⇒ InfoResponse
constructor
A new instance of InfoResponse.
Constructor Details
#initialize(json_response, recursion = 0) ⇒ InfoResponse
Returns a new instance of InfoResponse.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/clarifai_ruby/info_response.rb', line 4 def initialize(json_response, recursion=0) #parse the json response and make each key available json_response.each do |name, value| if value.is_a? Hash initialize(value, recursion+1) else self.class.send(:attr_reader, name) instance_variable_set("@#{name}", value) end end end |