Module: PDC::Resource::Identity::ClassMethods
- Defined in:
- lib/pdc/resource/identity.rb
Instance Method Summary collapse
- #primary_key ⇒ Object
- #primary_key=(value) ⇒ Object
-
#resource_path ⇒ Object
returns <version>/<resource-name> from the class.name.
- #uri(value = nil) ⇒ Object
Instance Method Details
#primary_key ⇒ Object
10 11 12 |
# File 'lib/pdc/resource/identity.rb', line 10 def primary_key @primary_key ||= default_primary_key end |
#primary_key=(value) ⇒ Object
14 15 16 |
# File 'lib/pdc/resource/identity.rb', line 14 def primary_key=(value) @primary_key = value end |
#resource_path ⇒ Object
returns <version>/<resource-name> from the class.name
23 24 25 |
# File 'lib/pdc/resource/identity.rb', line 23 def resource_path @resource_path ||= model_name.collection.sub(%r{^pdc\/}, '').tr('_', '-') end |