Module: ArcWeld::Relationships::LocationOf

Defined in:
lib/arc_weld/relationships/location_of.rb

Instance Method Summary collapse

Instance Method Details

#add_location_resource(res) ⇒ Object



4
5
6
7
8
9
# File 'lib/arc_weld/relationships/location_of.rb', line 4

def add_location_resource(res)
  unless location_of.include?(res)
    location_of.push(res)
    res.has_location=self unless res.has_location==self
  end
end

#add_location_resources(*resources) ⇒ Object



11
12
13
# File 'lib/arc_weld/relationships/location_of.rb', line 11

def add_location_resources(*resources)
  resources.each { |res| add_location_resource(res) }
end

#location_of_relationshipObject



19
20
21
22
23
24
25
# File 'lib/arc_weld/relationships/location_of.rb', line 19

def location_of_relationship
  unless location_of.empty?
    { 'locationOf' => {
        'list!' => related_location_of_references
    }}
  end
end


15
16
17
# File 'lib/arc_weld/relationships/location_of.rb', line 15

def related_location_of_references
  (location_of.map { |resource| resource.ref.render }).join
end