Class: Syntaxdb::Concept
- Inherits:
-
Object
- Object
- Syntaxdb::Concept
- Defined in:
- lib/syntaxdb/concept.rb
Instance Attribute Summary collapse
-
#concept_id ⇒ Object
Returns the value of attribute concept_id.
-
#concept_permalink ⇒ Object
Returns the value of attribute concept_permalink.
Class Method Summary collapse
- .all(options = {}) ⇒ Object
- .find(options = {}) ⇒ Object
- .find_category_concepts(options = {}) ⇒ Object
- .language_concepts(options = {}) ⇒ Object
- .search ⇒ Object
- .search_concepts(options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(concept_id = nil, permalink = nil) ⇒ Concept
constructor
A new instance of Concept.
Constructor Details
#initialize(concept_id = nil, permalink = nil) ⇒ Concept
7 8 9 10 |
# File 'lib/syntaxdb/concept.rb', line 7 def initialize(concept_id = nil, permalink = nil) @concept_id = concept_id @concept_permalink = permalink end |
Instance Attribute Details
#concept_id ⇒ Object
Returns the value of attribute concept_id.
5 6 7 |
# File 'lib/syntaxdb/concept.rb', line 5 def concept_id @concept_id end |
#concept_permalink ⇒ Object
Returns the value of attribute concept_permalink.
5 6 7 |
# File 'lib/syntaxdb/concept.rb', line 5 def concept_permalink @concept_permalink end |
Class Method Details
.all(options = {}) ⇒ Object
17 18 19 |
# File 'lib/syntaxdb/concept.rb', line 17 def all( = {}) Syntaxdb::Request.send_request(, '/concepts') end |
.find(options = {}) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/syntaxdb/concept.rb', line 21 def find( = {}) @concept_id = [:concept_id] if @concept_id .delete(:concept_id) Syntaxdb::Request.send_request(, "/concepts/#{@concept_id}") end end |
.find_category_concepts(options = {}) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/syntaxdb/concept.rb', line 51 def find_category_concepts( = {}) language_permalink = [:language_permalink] category_id = [:category_id] if language_permalink && category_id .delete(:category_id) .delete(:language_permalink) Syntaxdb::Request.send_request(, "/languages/#{language_permalink}/categories/#{category_id}/concepts") end end |
.language_concepts(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/syntaxdb/concept.rb', line 29 def language_concepts( = {}) @concept_permalink = [:concept_permalink] language_permalink = [:language_permalink] if language_permalink .delete(:language_permalink) if @concept_permalink .delete(:concept_permalink) Syntaxdb::Request.send_request(, "/languages/#{language_permalink}/concepts/#{@concept_permalink}") else Syntaxdb::Request.send_request(, "/languages/#{language_permalink}/concepts") end end end |
.search ⇒ Object
14 15 |
# File 'lib/syntaxdb/concept.rb', line 14 def search end |
.search_concepts(options = {}) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/syntaxdb/concept.rb', line 43 def search_concepts( = {}) language_permalink = [:language_permalink] if language_permalink .delete(:language_permalink) Syntaxdb::Request.send_request(, "/languages/#{language_permalink}/concepts/search") end end |