Module: ActiveFedora::FedoraAttributes

Included in:
Base
Defined in:
lib/active_fedora/fedora_attributes.rb

Instance Method Summary collapse

Instance Method Details

#create_dateObject

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

#idObject

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

#labelObject



26
27
28
# File 'lib/active_fedora/fedora_attributes.rb', line 26

def label
  Array(@inner_object.label).first
end

#modified_dateObject

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_idObject

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

#pidObject

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

#stateObject



30
31
32
# File 'lib/active_fedora/fedora_attributes.rb', line 30

def state
  Array(@inner_object.state).first
end