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



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

def write_attribute(attribute_name, value)
  if self.class.properties.key?(attribute_name)
    @attributes[attribute_name] = value
  else
    raise ActiveModel::MissingAttributeError, "can't write unknown attribute `#{attribute_name}'"
  end
end