class Occi::Core::Links

Public Class Methods

new(links=[]) click to toggle source
Calls superclass method Occi::Core::Entities.new
# File lib/occi/core/links.rb, line 5
def initialize(links=[])
  links.collect! {|link| convert link} if links
  super links
end

Public Instance Methods

<<(link) click to toggle source
Calls superclass method Occi::Core::Entities#<<
# File lib/occi/core/links.rb, line 10
def <<(link)
  super convert link
end
create(*args) click to toggle source
# File lib/occi/core/links.rb, line 14
def create(*args)
  link       = Occi::Core::Link.new(*args)
  link.model = @model if @model
  self << link

  link
end

Private Instance Methods

convert(link) click to toggle source
# File lib/occi/core/links.rb, line 24
def convert(link)
  if link.kind_of? String
    link_location = link
    link = Occi::Core::Link.new
    link.id = link_location.split('/').last
    link.location = link_location
  end

  link
end