# File lib/occi4/core/links.rb, line 12 def initialize(links=[]) links.collect! {|link| convert link} if links super links end
# File lib/occi4/core/links.rb, line 17 def <<(link) super convert link end
# File lib/occi4/core/links.rb, line 5 def collect! block_given? or return enum_for(__method__) set = self.class.new each { |o| set << yield(o) } replace(set) end
# File lib/occi4/core/links.rb, line 21 def create(*args) link = Occi::Core::Link.new(*args) link.model = @model if @model self << link link end
# File lib/occi4/core/links.rb, line 31 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