Module: PDC::Resource::Identity::ClassMethods

Defined in:
lib/pdc/resource/identity.rb

Instance Method Summary collapse

Instance Method Details

#primary_keyObject



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_pathObject

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

#uri(value = nil) ⇒ Object



18
19
20
# File 'lib/pdc/resource/identity.rb', line 18

def uri(value = nil)
  @uri ||= Path.new(value || default_uri).to_s
end