Class: AmazingPrint::Formatters::MethodFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- AmazingPrint::Formatters::MethodFormatter
- Defined in:
- lib/amazing_print/formatters/method_formatter.rb
Constant Summary
Constants inherited from BaseFormatter
BaseFormatter::DEFAULT_LIMIT_SIZE, BaseFormatter::INDENT_CACHE
Instance Attribute Summary collapse
-
#inspector ⇒ Object
readonly
Returns the value of attribute inspector.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(method, inspector) ⇒ MethodFormatter
constructor
A new instance of MethodFormatter.
Methods inherited from BaseFormatter
#align, #get_limit_size, #indent, #indentation, #indented, #limited, #method_tuple, #outdent, #should_be_limited?
Methods included from Colorize
Constructor Details
#initialize(method, inspector) ⇒ MethodFormatter
Returns a new instance of MethodFormatter.
10 11 12 13 14 15 |
# File 'lib/amazing_print/formatters/method_formatter.rb', line 10 def initialize(method, inspector) super() @method = method @inspector = inspector @options = inspector. end |
Instance Attribute Details
#inspector ⇒ Object (readonly)
Returns the value of attribute inspector.
8 9 10 |
# File 'lib/amazing_print/formatters/method_formatter.rb', line 8 def inspector @inspector end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/amazing_print/formatters/method_formatter.rb', line 8 def method @method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/amazing_print/formatters/method_formatter.rb', line 8 def @options end |
Instance Method Details
#format ⇒ Object
17 18 19 20 21 |
# File 'lib/amazing_print/formatters/method_formatter.rb', line 17 def format name, args, owner = method_tuple(method) "#{colorize(owner, :class)}##{colorize(name, :method)}#{colorize(args, :args)}" end |