Class: Redfinger::Link

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/redfinger/link.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml_link) ⇒ Link

Returns a new instance of Link.



6
7
8
9
10
# File 'lib/redfinger/link.rb', line 6

def initialize(xml_link)
  self[:rel] = xml_link['rel']
  self[:href] = xml_link['href']
  self[:type] = xml_link['type']
end

Instance Method Details

#to_sObject

Outputs the URL of the link, useful for using a Link directly in other libraries.



14
15
16
# File 'lib/redfinger/link.rb', line 14

def to_s
  self.href
end