Module: ActiveFedora::AttributeMethods::Write

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_fedora/attribute_methods/write.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#write_attribute(attribute_name, value) ⇒ Object

Raises:

  • (ActiveModel::MissingAttributeError)


29
30
31
32
33
# File 'lib/active_fedora/attribute_methods/write.rb', line 29

def write_attribute(attribute_name, value)
  raise ActiveModel::MissingAttributeError, "can't write unknown attribute `#{attribute_name}'" unless self.class.properties.key?(attribute_name)

  attributes[attribute_name] = value
end