Method: Welo::Resource::ClassMethods#relationship

Defined in:
lib/welo/core/resource.rb

#relationship(sym, klass = nil, kinds = []) ⇒ Object

If one argument, returns the relationship with the given name If more than one argument, registers a new relationship, possibly overwriting it.



54
55
56
57
58
59
60
# File 'lib/welo/core/resource.rb', line 54

def relationship(sym, klass=nil, kinds=[])
  if klass
    relationships[sym] = Relationship.new(sym, klass, kinds)
  else
    relationships[sym]
  end
end