Module: Taskrabbit::Association::InstanceMethods

Defined in:
lib/taskrabbit/association.rb

Instance Method Summary collapse

Instance Method Details

#association_path(klass) ⇒ Object

return the association path on the api that correspond to the class



28
29
30
31
32
33
34
35
36
37
# File 'lib/taskrabbit/association.rb', line 28

def association_path(klass)
  case paths[klass]
  when String
    paths[klass]
  when Proc
    paths[klass][self]
  else
    raise Error.new("Action not defined for #{self.class} on the #{klass} association")
  end
end