Class: RailsConsolePro::BasePrinter
- Inherits:
-
Object
- Object
- RailsConsolePro::BasePrinter
- Includes:
- ColorHelper
- Defined in:
- lib/rails_console_pro/base_printer.rb
Overview
Base printer class with common functionality
Direct Known Subclasses
Printers::ActiveRecordPrinter, Printers::CollectionPrinter, Printers::ComparePrinter, Printers::DiffPrinter, Printers::ExplainPrinter, Printers::IntrospectPrinter, Printers::ProfilePrinter, Printers::QueryBuilderPrinter, Printers::QueueInsightsPrinter, Printers::RelationPrinter, Printers::SchemaPrinter, Printers::SnippetCollectionPrinter, Printers::SnippetPrinter, Printers::StatsPrinter
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#pry_instance ⇒ Object
readonly
Returns the value of attribute pry_instance.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(output, value, pry_instance) ⇒ BasePrinter
constructor
A new instance of BasePrinter.
- #print ⇒ Object
Methods included from ColorHelper
#color, #method_missing, #pastel, #respond_to_missing?
Constructor Details
#initialize(output, value, pry_instance) ⇒ BasePrinter
Returns a new instance of BasePrinter.
10 11 12 13 14 |
# File 'lib/rails_console_pro/base_printer.rb', line 10 def initialize(output, value, pry_instance) @output = output @value = value @pry_instance = pry_instance end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RailsConsolePro::ColorHelper
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
8 9 10 |
# File 'lib/rails_console_pro/base_printer.rb', line 8 def output @output end |
#pry_instance ⇒ Object (readonly)
Returns the value of attribute pry_instance.
8 9 10 |
# File 'lib/rails_console_pro/base_printer.rb', line 8 def pry_instance @pry_instance end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/rails_console_pro/base_printer.rb', line 8 def value @value end |
Instance Method Details
#print ⇒ Object
16 17 18 |
# File 'lib/rails_console_pro/base_printer.rb', line 16 def print Pry::ColorPrinter.default(output, value, pry_instance) end |