Module: ArcWeld::Relationships::CustomerOf
- Defined in:
- lib/arc_weld/relationships/customer_of.rb
Instance Method Summary collapse
- #add_customer_resource(res) ⇒ Object
- #add_customer_resources(*resources) ⇒ Object
- #customer_of_relationship ⇒ Object
- #related_customer_of_references ⇒ Object
Instance Method Details
#add_customer_resource(res) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/arc_weld/relationships/customer_of.rb', line 4 def add_customer_resource(res) unless customer_of.include?(res) customer_of.push(res) res.add_customer(self) end end |
#add_customer_resources(*resources) ⇒ Object
11 12 13 |
# File 'lib/arc_weld/relationships/customer_of.rb', line 11 def add_customer_resources(*resources) resources.each { |res| add_customer_resource(res) } end |
#customer_of_relationship ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/arc_weld/relationships/customer_of.rb', line 19 def customer_of_relationship unless customer_of.empty? { 'customerOf' => { 'list!' => }} end end |
#related_customer_of_references ⇒ Object
15 16 17 |
# File 'lib/arc_weld/relationships/customer_of.rb', line 15 def (customer_of.map { |resource| resource.ref.render }).join end |