Class: Inch::CLI::Command::BaseObject Abstract
- Defined in:
- lib/inch/cli/command/base_object.rb
Overview
This class is abstract.
Base class for Command objects concerned with clearly specified objects.
Commands subclassing from this class are called with a list of object names (most commonly only one) in the form:
$ inch COMMAND [paths] OBJECT_NAME [, OBJECT_NAME2, ...] [options]
Direct Known Subclasses
Console, Inspect, Options::Console, Options::Inspect, Options::Show, Show
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#objects ⇒ Object
Returns the value of attribute objects.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ BaseObject
constructor
A new instance of BaseObject.
-
#prepare_objects(*args) ⇒ void
Prepares the given objects, parsing arguments and running the source parser.
Methods inherited from Base
#description, #name, run, #run, #usage
Methods included from TraceHelper
Constructor Details
#initialize ⇒ BaseObject
Returns a new instance of BaseObject.
16 17 18 19 |
# File 'lib/inch/cli/command/base_object.rb', line 16 def initialize super @ranges = Evaluation.new_score_ranges end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
14 15 16 |
# File 'lib/inch/cli/command/base_object.rb', line 14 def object @object end |
#objects ⇒ Object
Returns the value of attribute objects.
14 15 16 |
# File 'lib/inch/cli/command/base_object.rb', line 14 def objects @objects end |
Instance Method Details
#prepare_objects(*args) ⇒ void
This method returns an undefined value.
Prepares the given objects, parsing arguments and running the source parser.
26 27 28 29 30 31 32 33 |
# File 'lib/inch/cli/command/base_object.rb', line 26 def prepare_objects(*args) @options.parse(args) @options.verify run_source_parser(@options.paths, @options.excluded) self.objects = find_objects_with_names(@options.object_names) self.object = @objects.first end |