Module: FedoraLens::AttributeMethods::Declarations::ClassMethods

Defined in:
lib/fedora_lens/attribute_methods/declarations.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, path) ⇒ Object

Raises:

  • (AttributeNotSupportedException)

22
23
24
25
26
27
# File 'lib/fedora_lens/attribute_methods/declarations.rb', line 22

def attribute(name, path)
  raise AttributeNotSupportedException if name.to_sym == :id
  attributes_as_lenses[name] = path.map{|s| coerce_to_lens(s)}
  generate_method(name)
  orm_to_hash = nil # force us to rebuild the aggregate_lens in case it was already built.
end