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