Class: RailsConsolePro::BasePrinter

Inherits:
Object
  • Object
show all
Includes:
ColorHelper
Defined in:
lib/rails_console_pro/base_printer.rb

Overview

Base printer class with common functionality

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#outputObject (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_instanceObject (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

#valueObject (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



16
17
18
# File 'lib/rails_console_pro/base_printer.rb', line 16

def print
  Pry::ColorPrinter.default(output, value, pry_instance)
end