Class: Inch::CLI::Command::Output::Console
- Extended by:
- Forwardable
- Defined in:
- lib/inch/cli/command/output/console.rb
Constant Summary collapse
- COLOR =
magenta-ish
:color198
- BG_COLOR =
magenta-ish
:color207
Instance Attribute Summary collapse
-
#codebase ⇒ Object
readonly
Returns the value of attribute codebase.
-
#object ⇒ Object
(also: #o)
readonly
Returns the value of attribute object.
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
Instance Method Summary collapse
- #all_objects ⇒ Object (also: #all)
- #find_object(fullname) ⇒ Object (also: #f)
- #find_objects(fullname) ⇒ Object (also: #ff)
-
#initialize(options, object, objects, codebase) ⇒ Console
constructor
A new instance of Console.
- #run ⇒ Object
- #run_pry ⇒ Object
Methods inherited from Base
#print_file_info, #priority_arrow
Methods included from TraceHelper
Constructor Details
#initialize(options, object, objects, codebase) ⇒ Console
Returns a new instance of Console.
17 18 19 20 21 22 23 24 |
# File 'lib/inch/cli/command/output/console.rb', line 17 def initialize(, object, objects, codebase) @options = @object = object @objects = objects @codebase = codebase run end |
Instance Attribute Details
#codebase ⇒ Object (readonly)
Returns the value of attribute codebase.
8 9 10 |
# File 'lib/inch/cli/command/output/console.rb', line 8 def codebase @codebase end |
#object ⇒ Object (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 |
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
8 9 10 |
# File 'lib/inch/cli/command/output/console.rb', line 8 def objects @objects end |
Instance Method Details
#all_objects ⇒ Object Also known as: all
26 27 28 |
# File 'lib/inch/cli/command/output/console.rb', line 26 def all_objects @codebase.objects.all end |
#find_object(fullname) ⇒ Object Also known as: f
34 35 36 |
# File 'lib/inch/cli/command/output/console.rb', line 34 def find_object(fullname) @codebase.objects.find(fullname) end |
#find_objects(fullname) ⇒ Object Also known as: ff
30 31 32 |
# File 'lib/inch/cli/command/output/console.rb', line 30 def find_objects(fullname) @codebase.objects.starting_with(fullname) end |
#run ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/inch/cli/command/output/console.rb', line 44 def run ui.trace ui.header("Welcome to Inch's console", COLOR, BG_COLOR) ui.sub @options.usage @options.descriptions.each do |line| ui.sub line end run_pry end |
#run_pry ⇒ Object
54 55 56 |
# File 'lib/inch/cli/command/output/console.rb', line 54 def run_pry binding.pry end |