Class: Clarinet::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/clarinet/input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#conceptsObject (readonly)

Returns the value of attribute concepts.



9
10
11
# File 'lib/clarinet/input.rb', line 9

def concepts
  @concepts
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/clarinet/input.rb', line 7

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/clarinet/input.rb', line 6

def id
  @id
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



8
9
10
# File 'lib/clarinet/input.rb', line 8

def image_url
  @image_url
end

#metadataObject (readonly)

Returns the value of attribute metadata.



11
12
13
# File 'lib/clarinet/input.rb', line 11

def 
  @metadata
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



12
13
14
# File 'lib/clarinet/input.rb', line 12

def raw_data
  @raw_data
end

#scoreObject (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