module ActiveFedora::RegisteredAttributes

Constants

VERSION

Public Class Methods

new(*) click to toggle source

Applies attribute default values

Calls superclass method
# File lib/active_fedora/registered_attributes.rb, line 67
def initialize(*)
  super
  apply_defaults
end

Public Instance Methods

terms_for_display() click to toggle source
# File lib/active_fedora/registered_attributes.rb, line 76
def terms_for_display
  displayable_attributes.collect(&:name)
end
terms_for_editing() click to toggle source
# File lib/active_fedora/registered_attributes.rb, line 72
def terms_for_editing
  editable_attributes.collect(&:name)
end

Protected Instance Methods

apply_defaults(defaults=attribute_defaults) click to toggle source
# File lib/active_fedora/registered_attributes.rb, line 81
def apply_defaults(defaults=attribute_defaults)
  defaults.each do |name, value|
    if !value.nil? && !persisted?
      send("#{name}=", value) # unless send("#{name}").present?
    end
  end
end

Private Instance Methods

attribute_registry() click to toggle source
# File lib/active_fedora/registered_attributes.rb, line 16
def attribute_registry
  self.class.attribute_registry
end