Module: ActiveFedora::Identifiable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_fedora/identifiable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #id ⇒ Object
- #id=(id) ⇒ Object
-
#uri ⇒ RDF::URI
The uri for this resource.
Instance Method Details
#id ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/active_fedora/identifiable.rb', line 19 def id if uri.is_a?(::RDF::URI) && uri.value.blank? nil elsif uri.present? self.class.uri_to_id(URI.parse(uri)) end end |
#id=(id) ⇒ Object
27 28 29 30 |
# File 'lib/active_fedora/identifiable.rb', line 27 def id=(id) raise "ID has already been set to #{self.id}" if self.id @ldp_source = build_ldp_resource(id.to_s) end |
#uri ⇒ RDF::URI
Returns the uri for this resource.
33 34 35 |
# File 'lib/active_fedora/identifiable.rb', line 33 def uri @ldp_source.subject_uri end |