class EacRubyUtils::Immutable::CommonAccessor

def apply(klass)

def apply(klass)
  accessor = self
  klass.send(:define_method, name) do |*args|
    case args.count
    when 0 then next accessor.immutable_value_get(self)
    when 1 then next accessor.immutable_value_set(self, args.first)
    else
      raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 0..1)"
    end
  end
end