Sha256: fc895697b1b146912d0a97ab74e3fcb70fd75be1c996012da458e28e123eaea6

Contents?: true

Size: 250 Bytes

Versions: 2

Compression:

Stored size: 250 Bytes

Contents

module NamedAccessors
  module NamedWriter
    def named_writer(name, options={})
      variable = instance_variable_name(name)

      define_method setter_name(options) do |val|
        instance_variable_set variable, val
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
named_accessors-1.1 lib/named_accessors/named_writer.rb
named_accessors-1.0 lib/named_accessors/named_writer.rb