Class: Schoolmaster::BaseAnalyser
- Inherits:
-
Object
- Object
- Schoolmaster::BaseAnalyser
- Defined in:
- lib/schoolmaster/analysers/base_analyser.rb
Direct Known Subclasses
BestPracticesAnalyser, BrakemanAnalyser, CaneAnalyser, TestAnalyser
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #default_args ⇒ Object
-
#initialize(params) ⇒ BaseAnalyser
constructor
A new instance of BaseAnalyser.
- #run ⇒ Object
Constructor Details
#initialize(params) ⇒ BaseAnalyser
Returns a new instance of BaseAnalyser.
5 6 7 8 |
# File 'lib/schoolmaster/analysers/base_analyser.rb', line 5 def initialize(params) @command = params.fetch(:command, "") @args = params.fetch(:args, []) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/schoolmaster/analysers/base_analyser.rb', line 3 def args @args end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/schoolmaster/analysers/base_analyser.rb', line 3 def command @command end |
Instance Method Details
#default_args ⇒ Object
15 16 17 |
# File 'lib/schoolmaster/analysers/base_analyser.rb', line 15 def default_args [] end |
#run ⇒ Object
10 11 12 13 |
# File 'lib/schoolmaster/analysers/base_analyser.rb', line 10 def run arg_str = (args | default_args).join(" ") system("#{command} #{arg_str}") end |