Class: GimmeWikidata::SearchResult
- Inherits:
-
Object
- Object
- GimmeWikidata::SearchResult
- Defined in:
- lib/gimme_wikidata/search.rb
Overview
TODO: DOCUMENT THIS CLASS
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(id, label, description) ⇒ SearchResult
constructor
A new instance of SearchResult.
Constructor Details
#initialize(id, label, description) ⇒ SearchResult
Returns a new instance of SearchResult.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/gimme_wikidata/search.rb', line 37 def initialize(id, label, description) @id = id @label = label @description = description case @id[0] when 'Q' @type = Item when 'P' @type = Property else @type = :unknown_type end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
35 36 37 |
# File 'lib/gimme_wikidata/search.rb', line 35 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
35 36 37 |
# File 'lib/gimme_wikidata/search.rb', line 35 def id @id end |
#label ⇒ Object
Returns the value of attribute label.
35 36 37 |
# File 'lib/gimme_wikidata/search.rb', line 35 def label @label end |
#type ⇒ Object
Returns the value of attribute type.
35 36 37 |
# File 'lib/gimme_wikidata/search.rb', line 35 def type @type end |