Sha256: 56bc66dd80b4679d0cdf9837def7f939b8b911abe849997052b056ed57baeab2

Contents?: true

Size: 239 Bytes

Versions: 2

Compression:

Stored size: 239 Bytes

Contents

module NamedAccessors
  module NamedReader
    def named_reader(name, options={})
      variable = instance_variable_name(name)

      define_method getter_name(options) do
        instance_variable_get variable
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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