Class: ClarifaiRuby::ColorResponse
- Inherits:
-
Object
- Object
- ClarifaiRuby::ColorResponse
- Defined in:
- lib/clarifai_ruby/color_response.rb
Instance Attribute Summary collapse
-
#colors ⇒ Object
readonly
Returns the value of attribute colors.
-
#docid_str ⇒ Object
readonly
Returns the value of attribute docid_str.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#status_msg ⇒ Object
readonly
Returns the value of attribute status_msg.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(json_response) ⇒ ColorResponse
constructor
A new instance of ColorResponse.
Constructor Details
#initialize(json_response) ⇒ ColorResponse
Returns a new instance of ColorResponse.
6 7 8 9 10 11 12 13 |
# File 'lib/clarifai_ruby/color_response.rb', line 6 def initialize(json_response) @status_code = json_response["status_code"] @status_msg = json_response["status_msg"] @results = json_response["results"][0] @docid_str = @results["docid_str"] @url = @results["url"] @colors = @results["colors"] end |
Instance Attribute Details
#colors ⇒ Object (readonly)
Returns the value of attribute colors.
4 5 6 |
# File 'lib/clarifai_ruby/color_response.rb', line 4 def colors @colors end |
#docid_str ⇒ Object (readonly)
Returns the value of attribute docid_str.
4 5 6 |
# File 'lib/clarifai_ruby/color_response.rb', line 4 def docid_str @docid_str end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
4 5 6 |
# File 'lib/clarifai_ruby/color_response.rb', line 4 def status_code @status_code end |
#status_msg ⇒ Object (readonly)
Returns the value of attribute status_msg.
4 5 6 |
# File 'lib/clarifai_ruby/color_response.rb', line 4 def status_msg @status_msg end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/clarifai_ruby/color_response.rb', line 4 def url @url end |