Class: ClarifaiRuby::TagImage

Inherits:
Object
  • Object
show all
Defined in:
lib/clarifai_ruby/models/tag_image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_doc) ⇒ TagImage

Returns a new instance of TagImage.



13
14
15
16
17
18
19
20
21
22
# File 'lib/clarifai_ruby/models/tag_image.rb', line 13

def initialize(response_doc)
  @docid = response_doc["docid"]
  @docid_str = response_doc["docid_str"]
  @url = response_doc["url"]
  @status_code = response_doc["status_code"]
  @status_msg = response_doc["status_msg"]
  @local_id = response_doc["local_id"]
  @tags = generate_tags response_doc["result"]["tag"]
  @tags_by_words = response_doc["result"]["tag"]["classes"]
end

Instance Attribute Details

#docidObject (readonly)

Returns the value of attribute docid.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def docid
  @docid
end

#docid_strObject (readonly)

Returns the value of attribute docid_str.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def docid_str
  @docid_str
end

#local_idObject (readonly)

Returns the value of attribute local_id.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def local_id
  @local_id
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def status_code
  @status_code
end

#status_msgObject (readonly)

Returns the value of attribute status_msg.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def status_msg
  @status_msg
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def tags
  @tags
end

#tags_by_wordsObject (readonly)

Returns the value of attribute tags_by_words.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def tags_by_words
  @tags_by_words
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/clarifai_ruby/models/tag_image.rb', line 3

def url
  @url
end