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
35 36 37 38 39 40 41 |
# File 'lib/active_fedora/identifiable.rb', line 35 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
43 44 45 46 |
# File 'lib/active_fedora/identifiable.rb', line 43 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.
49 50 51 |
# File 'lib/active_fedora/identifiable.rb', line 49 def uri @ldp_source.subject_uri end |