Module: Her::Model::Paths

Extended by:
ActiveSupport::Concern
Included in:
Her::Model
Defined in:
lib/her/model/paths.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#request_path(params = {}) ⇒ Object

Return a path based on the collection path and a resource data

Examples:

class User
  include Her::Model
  collection_path "/utilisateurs"
end

User.find(1) # Fetched via GET /utilisateurs/1


17
18
19
# File 'lib/her/model/paths.rb', line 17

def request_path(params = {})
  self.class.build_request_path(params.merge(attributes.dup))
end