global

def method_body(method_name, const_name)

key the @attributes_cache in read_attribute.
Making it frozen means that it doesn't get duped when used to
to allocate an object on each call to the attribute method.
the attribute name. Using a constant means that we do not have
We are also defining a constant to hold the frozen string of

it to what we want.
the __temp__ identifier, and then use alias method to rename
'my_column(omg)'. So to work around this we first define with
characters that are not allowed in normal method names (like
But sometimes the database might return columns with

created, then define_method will consume much less memory.
be slower on dispatch, but if you're careful about the closure
sequences are duplicated and cached (in MRI). define_method may
Evaluating many similar methods may use more memory as the instruction
define_method, because define_method is slower on dispatch.
We want to generate the methods via module_eval rather than
def method_body(method_name, const_name)
  <<-EOMETHOD
  def #{method_name}
    name = ::ActiveFedora::AttributeMethods::AttrNames::ATTR_#{const_name}
    read_attribute(name) { |n| missing_attribute(n, caller) }
  end
  EOMETHOD
end