Class: Naught::NullClassBuilder::Commands::Pebble Private
- Inherits:
-
Naught::NullClassBuilder::Command
- Object
- Naught::NullClassBuilder::Command
- Naught::NullClassBuilder::Commands::Pebble
- Defined in:
- lib/naught/null_class_builder/commands/pebble.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Logs missing method calls and their call sites
Instance Attribute Summary
Attributes inherited from Naught::NullClassBuilder::Command
Instance Method Summary collapse
-
#call ⇒ void
private
Install the logging method_missing hook.
-
#initialize(builder, output = $stdout) ⇒ Pebble
constructor
private
Create a pebble command with optional output stream.
Constructor Details
#initialize(builder, output = $stdout) ⇒ Pebble
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.
Create a pebble command with optional output stream
15 16 17 18 |
# File 'lib/naught/null_class_builder/commands/pebble.rb', line 15 def initialize(builder, output = $stdout) super(builder) @output = output end |
Instance Method Details
#call ⇒ 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.
Install the logging method_missing hook
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/naught/null_class_builder/commands/pebble.rb', line 23 def call output = @output defer_prepend_module do define_method(:method_missing) do |method_name, *args| pretty_args = args.map(&:inspect).join(", ").tr('"', "'") caller_desc = Naught::CallerInfo.format_caller_for_pebble(Kernel.caller(1)) output.puts "#{method_name}(#{pretty_args}) from #{caller_desc}" self end end end |