Class: XFN::Link

Inherits:
OpenStruct show all
Defined in:
lib/mofo/xfn.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Link

Returns a new instance of Link.



27
28
29
30
31
32
# File 'lib/mofo/xfn.rb', line 27

def initialize(*args)
  super
  def relation.has?(value)
    is_a?(Array) ? include?(value) : self == value
  end
end

Instance Method Details

#to_htmlObject



34
35
36
# File 'lib/mofo/xfn.rb', line 34

def to_html
  %[<a href="#{link}" rel="#{Array(relation) * ' '}">#{name}</a>]
end

#to_sObject



38
39
40
# File 'lib/mofo/xfn.rb', line 38

def to_s
  link
end