module Pry::Config::Attributable
Attributable
provides the ability to create “attribute” accessors. Attribute accessors create a standard “attr_writer” and a customised “attr_reader”. This reader is Proc-aware (lazy).
@since v0.13.0 @api private
Public Instance Methods
attribute(attr_name)
click to toggle source
# File lib/pry/config/attributable.rb, line 12 def attribute(attr_name) define_method(attr_name) do value = Config::Value.new(instance_variable_get("@#{attr_name}")) value.call end attr_writer(attr_name) end