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)


36
37
38
39
40
# File 'lib/active_fedora/attribute_methods/write.rb', line 36

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