class Medie::Xml::Links

Public Class Methods

new(links) click to toggle source
# File lib/medie/xml/links.rb, line 5
def initialize(links)
  @hash = {}
  links = [links] unless links.kind_of? Array
  links = [] unless links
  links.each { |l|
    link = Medie::Link.new(l)
    @hash[link.rel.to_s] = link
  }
end

Public Instance Methods

[](name) click to toggle source
# File lib/medie/xml/links.rb, line 15
def [](name)
  @hash[name]
end
keys() click to toggle source
# File lib/medie/xml/links.rb, line 23
def keys
  @hash.keys
end
method_missing(sym, *args) click to toggle source
# File lib/medie/xml/links.rb, line 27
def method_missing(sym, *args)
  raise "Links can not receive arguments" unless args.empty?
  self[sym.to_s]
end
size() click to toggle source
# File lib/medie/xml/links.rb, line 19
def size
  @hash.size
end