Class: Inch::CLI::Command::Output::Console

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/inch/cli/command/output/console.rb

Constant Summary collapse

COLOR =

magenta-ish

:color198
BG_COLOR =

magenta-ish

:color207

Constants inherited from Base

Base::PRIORITY_ARROWS, Base::PRIORITY_MAP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#priority_arrow

Methods included from TraceHelper

#debug, #trace, #trace_header

Constructor Details

#initialize(options, object, objects, source_parser) ⇒ Console

Returns a new instance of Console.

Parameters:



23
24
25
26
27
28
29
30
# File 'lib/inch/cli/command/output/console.rb', line 23

def initialize(options, object, objects, source_parser)
  @options = options
  @object = object
  @objects = objects
  @source_parser = source_parser

  run
end

Instance Attribute Details

#objectObject (readonly) Also known as: o

Returns the value of attribute object.



8
9
10
# File 'lib/inch/cli/command/output/console.rb', line 8

def object
  @object
end

#objectsObject (readonly)

Returns the value of attribute objects.



8
9
10
# File 'lib/inch/cli/command/output/console.rb', line 8

def objects
  @objects
end

#source_parserObject (readonly)

Returns the value of attribute source_parser.



8
9
10
# File 'lib/inch/cli/command/output/console.rb', line 8

def source_parser
  @source_parser
end

Instance Method Details

#runObject



32
33
34
35
36
37
38
39
40
# File 'lib/inch/cli/command/output/console.rb', line 32

def run
  trace
  trace_header("Welcome to Inch's console", COLOR, BG_COLOR)
  trace edged(COLOR, @options.usage)
  @options.descriptions.each do |line|
    trace edged(COLOR, line)
  end
  run_pry
end

#run_pryObject



42
43
44
# File 'lib/inch/cli/command/output/console.rb', line 42

def run_pry
  binding.pry
end