Class: FreebaseAPI::Attribute
- Inherits:
-
Object
- Object
- FreebaseAPI::Attribute
- Defined in:
- lib/freebase_api/attribute.rb
Overview
Attribute can be any Freebase data type
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data, options = {}) ⇒ Attribute
constructor
A new instance of Attribute.
- #inspect ⇒ Object
- #lang ⇒ Object
- #text ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(data, options = {}) ⇒ Attribute
Returns a new instance of Attribute.
7 8 9 10 |
# File 'lib/freebase_api/attribute.rb', line 7 def initialize(data, ={}) @data = data @type = [:type] end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/freebase_api/attribute.rb', line 5 def type @type end |
Instance Method Details
#inspect ⇒ Object
28 29 30 |
# File 'lib/freebase_api/attribute.rb', line 28 def inspect "#<#{self.class}:0x#{self.__id__.to_s(16)} value: \"#{self.value}\", type: \"#{self.type}\">" end |
#lang ⇒ Object
20 21 22 |
# File 'lib/freebase_api/attribute.rb', line 20 def lang @data['lang'] end |
#text ⇒ Object
16 17 18 |
# File 'lib/freebase_api/attribute.rb', line 16 def text @data['text'] end |
#value ⇒ Object
12 13 14 |
# File 'lib/freebase_api/attribute.rb', line 12 def value @data['value'] end |