Module: Equalizer::InspectMethods Private
- Defined in:
- lib/equalizer.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance methods for inspect and pretty print output
Instance Method Summary collapse
-
#inspect ⇒ String
private
String representation showing only equalizer attributes.
-
#pretty_print(q) ⇒ void
private
Pretty print output using PP's object formatting.
-
#pretty_print_instance_variables ⇒ Array<Symbol>
private
Instance variables to display in pretty print output.
Instance Method Details
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
String representation showing only equalizer attributes
140 141 142 143 144 145 |
# File 'lib/equalizer.rb', line 140 def inspect attrs = equalizer_keys .map { |key| "@#{key}=#{public_send(key).inspect}" } .join(", ") Object.instance_method(:to_s).bind_call(self).sub(/>\z/, " #{attrs}>") end |
#pretty_print(q) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Pretty print output using PP's object formatting
151 152 153 |
# File 'lib/equalizer.rb', line 151 def pretty_print(q) q.pp_object(self) end |
#pretty_print_instance_variables ⇒ Array<Symbol>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instance variables to display in pretty print output
158 159 160 |
# File 'lib/equalizer.rb', line 158 def pretty_print_instance_variables equalizer_keys.map { |key| :"@#{key}" } end |