class Attribool::ReaderName
Abstraction of a readerโs method name.
Public Class Methods
Source
# File lib/attribool/reader_name.rb, line 13 def initialize(attribute, name) @attribute = attribute @name = name end
Instantiate new instance of ReaderName.
@param [String, Syumbol] attribute
@param [proc, nil, String, Symbol] name
Public Instance Methods
Source
# File lib/attribool/reader_name.rb, line 22 def to_s case @name when Proc then @name.call(@attribute) when nil then "#{@attribute}?" else @name.to_s end end
Convert instance to a string.
@return [String]