Class: Clarinet::Input
- Inherits:
-
Object
- Object
- Clarinet::Input
- Defined in:
- lib/clarinet/input.rb
Instance Attribute Summary collapse
-
#concepts ⇒ Object
readonly
Returns the value of attribute concepts.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
- #delete_concepts(concepts, metadata = nil) ⇒ Object
-
#initialize(app, raw_data) ⇒ Input
constructor
A new instance of Input.
- #merge_concepts(concepts, metadata = nil) ⇒ Object
- #overwrite_concepts(concepts, metadata = nil) ⇒ Object
Constructor Details
#initialize(app, raw_data) ⇒ Input
Returns a new instance of Input.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/clarinet/input.rb', line 14 def initialize(app, raw_data) @app = app @id = raw_data[:id] @created_at = raw_data[:created_at] @image_url = raw_data[:data][:image_url] @concepts = Clarinet::Concepts.new app, raw_data[:data][:concepts] @score = raw_data[:score] @metadata = raw_data[:data][:metadata] @raw_data = raw_data end |
Instance Attribute Details
#concepts ⇒ Object (readonly)
Returns the value of attribute concepts.
9 10 11 |
# File 'lib/clarinet/input.rb', line 9 def concepts @concepts end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/clarinet/input.rb', line 7 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/clarinet/input.rb', line 6 def id @id end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
8 9 10 |
# File 'lib/clarinet/input.rb', line 8 def image_url @image_url end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/clarinet/input.rb', line 11 def @metadata end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
12 13 14 |
# File 'lib/clarinet/input.rb', line 12 def raw_data @raw_data end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
10 11 12 |
# File 'lib/clarinet/input.rb', line 10 def score @score end |
Instance Method Details
#delete_concepts(concepts, metadata = nil) ⇒ Object
33 34 35 |
# File 'lib/clarinet/input.rb', line 33 def delete_concepts(concepts, = nil) update 'remove', concepts: concepts, metadata: end |
#merge_concepts(concepts, metadata = nil) ⇒ Object
29 30 31 |
# File 'lib/clarinet/input.rb', line 29 def merge_concepts(concepts, = nil) update 'merge', concepts: concepts, metadata: end |
#overwrite_concepts(concepts, metadata = nil) ⇒ Object
37 38 39 |
# File 'lib/clarinet/input.rb', line 37 def overwrite_concepts(concepts, = nil) update 'overwrite', concepts: concepts, metadata: end |