Class: Redfinger::Link

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

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) from_xml(xml_link)



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

def self.from_xml(xml_link)
  new_link = Link.new
  new_link[:rel]  = xml_link['rel']
  new_link[:href] = xml_link['href']
  new_link[:type] = xml_link['type']
  new_link
end

Instance Method Details

- (Object) to_s

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



16
17
18
# File 'lib/redfinger/link.rb', line 16

def to_s
  self.href
end