Class: ArelConverter::Command
- Inherits:
-
Object
- Object
- ArelConverter::Command
- Defined in:
- lib/arel_converter/command.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Command
constructor
A new instance of Command.
- #run! ⇒ Object
Constructor Details
#initialize(*args) ⇒ Command
Returns a new instance of Command.
9 10 11 12 13 14 |
# File 'lib/arel_converter/command.rb', line 9 def initialize(*args) args << '--help' if args.empty? @translators = ['scope','finder','association'] = {} parse_argv(*args) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/arel_converter/command.rb', line 7 def end |
Instance Method Details
#run! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/arel_converter/command.rb', line 16 def run! if @translators.include?('association') puts "== Checking Associations" ArelConverter::Association.new([:path], ).run! end if @translators.include?('scope') puts "\n== Checking Scopes" ArelConverter::Scope.new([:path], ).run! end if @translators.include?('finder') puts "\n== Checking Finders" ArelConverter::ActiveRecordFinder.new([:path], ).run! end end |