Class: Clarinet::Concepts
- Inherits:
-
Object
- Object
- Clarinet::Concepts
- Extended by:
- Forwardable
- Defined in:
- lib/clarinet/concepts.rb
Instance Method Summary collapse
- #create(concepts) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(app, raw_data = []) ⇒ Concepts
constructor
A new instance of Concepts.
- #list(options = { page: 1, per_page: 20 }) ⇒ Object
- #search(name, language = nil) ⇒ Object
Constructor Details
Instance Method Details
#create(concepts) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/clarinet/concepts.rb', line 18 def create(concepts) concepts = [concepts] unless concepts.is_a? Array concepts = concepts.map { |concept| format_concept(concept) } data = @app.client.concepts.create concepts Clarinet::Concepts.new @app, data[:concepts] end |
#get(id) ⇒ Object
31 32 33 34 |
# File 'lib/clarinet/concepts.rb', line 31 def get(id) data = @app.client.concept id Clarinet::Concept.new data[:concept] end |