Module: Videojuicer::Resource::Inferrable::InstanceMethods

Defined in:
lib/videojuicer/resource/inferrable.rb

Instance Method Summary collapse

Instance Method Details

#resource_path(action = nil, route_options = {}) ⇒ Object

Returns the appropriate resource path for this object. If the object is a new record, then the root object type path will be given. If the object is not new (has an ID) then the specific ID will be used.



40
41
42
43
44
# File 'lib/videojuicer/resource/inferrable.rb', line 40

def resource_path(action=nil, route_options={})
  route_options = {:id=>id}.merge(route_options) unless new_record?
  r = self.class.resource_route(action, route_options)
  self.class.compile_route(r, attributes)
end