Class: RIPE::Attribute
- Inherits:
-
Object
- Object
- RIPE::Attribute
- Defined in:
- lib/ripe/attribute.rb
Instance Method Summary collapse
-
#initialize(client, attribute) ⇒ Attribute
constructor
A new instance of Attribute.
- #name ⇒ Object
- #referenced_object ⇒ Object (also: #object)
- #referenced_type ⇒ Object
- #to_api_hash ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(client, attribute) ⇒ Attribute
Returns a new instance of Attribute.
4 5 6 7 |
# File 'lib/ripe/attribute.rb', line 4 def initialize(client, attribute) @client = client @attribute = attribute end |
Instance Method Details
#name ⇒ Object
9 10 11 |
# File 'lib/ripe/attribute.rb', line 9 def name @attribute['name'] end |
#referenced_object ⇒ Object Also known as: object
21 22 23 |
# File 'lib/ripe/attribute.rb', line 21 def referenced_object @referenced_object ||= referenced_type ? @client.find(self.referenced_type, self.value) : nil end |
#referenced_type ⇒ Object
17 18 19 |
# File 'lib/ripe/attribute.rb', line 17 def referenced_type @attribute['referenced-type'] end |
#to_api_hash ⇒ Object
26 27 28 29 30 31 |
# File 'lib/ripe/attribute.rb', line 26 def to_api_hash { 'name' => @attribute['name'], 'value' => @attribute['value'] } end |
#value ⇒ Object
13 14 15 |
# File 'lib/ripe/attribute.rb', line 13 def value @attribute['value'] end |