Module: ActiveFedora::FedoraAttributes
- Included in:
- Base
- Defined in:
- lib/active_fedora/fedora_attributes.rb
Instance Method Summary collapse
-
#create_date ⇒ Object
return the create_date of the inner object (unless it’s a new object).
-
#id ⇒ Object
Needed for the nested form helper.
- #label ⇒ Object
-
#modified_date ⇒ Object
return the modification date of the inner object (unless it’s a new object).
-
#owner_id ⇒ Object
return the owner id.
- #owner_id=(owner_id) ⇒ Object
-
#pid ⇒ Object
return the pid of the Fedora Object if there is no fedora object (loaded from solr) get the instance var TODO make inner_object a proxy that can hold the pid.
- #state ⇒ Object
Instance Method Details
#create_date ⇒ Object
return the create_date of the inner object (unless it’s a new object)
35 36 37 |
# File 'lib/active_fedora/fedora_attributes.rb', line 35 def create_date @inner_object.new_record? ? Time.now : Array(@inner_object.createdDate).first end |
#id ⇒ Object
Needed for the nested form helper
13 14 15 |
# File 'lib/active_fedora/fedora_attributes.rb', line 13 def id ### Needed for the nested form helper self.pid end |
#label ⇒ Object
26 27 28 |
# File 'lib/active_fedora/fedora_attributes.rb', line 26 def label Array(@inner_object.label).first end |
#modified_date ⇒ Object
return the modification date of the inner object (unless it’s a new object)
40 41 42 |
# File 'lib/active_fedora/fedora_attributes.rb', line 40 def modified_date @inner_object.new_record? ? Time.now : Array(@inner_object.lastModifiedDate).first end |
#owner_id ⇒ Object
return the owner id
18 19 20 |
# File 'lib/active_fedora/fedora_attributes.rb', line 18 def owner_id Array(@inner_object.ownerId).first end |
#owner_id=(owner_id) ⇒ Object
22 23 24 |
# File 'lib/active_fedora/fedora_attributes.rb', line 22 def owner_id=(owner_id) @inner_object.ownerId=(owner_id) end |
#pid ⇒ Object
return the pid of the Fedora Object if there is no fedora object (loaded from solr) get the instance var TODO make inner_object a proxy that can hold the pid
9 10 11 |
# File 'lib/active_fedora/fedora_attributes.rb', line 9 def pid @pid ||= @inner_object.pid end |
#state ⇒ Object
30 31 32 |
# File 'lib/active_fedora/fedora_attributes.rb', line 30 def state Array(@inner_object.state).first end |