Class: Alf::Shell::Main
- Inherits:
-
Object
- Object
- Alf::Shell::Main
- Includes:
- Support
- Defined in:
- lib/alf/shell/command/main.rb
Constant Summary
Constants included from Support
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#connection ⇒ Object
Alf’s options.
- #execute(argv) ⇒ Object
-
#initialize(config = load_config) ⇒ Main
constructor
Creates a command instance.
Methods included from Support
Constructor Details
#initialize(config = load_config) ⇒ Main
Creates a command instance
7 8 9 |
# File 'lib/alf/shell/command/main.rb', line 7 def initialize(config = load_config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/alf/shell/command/main.rb', line 10 def config @config end |
Instance Method Details
#connection ⇒ Object
Alf’s options
68 69 70 |
# File 'lib/alf/shell/command/main.rb', line 68 def connection @connection ||= config.database.connection(viewpoint: build_viewpoint) end |
#execute(argv) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/alf/shell/command/main.rb', line 72 def execute(argv) install_load_path install_requires # compile the operator, render and returns it super.tap do |op| render(connection.relvar(op)) if op && requester end end |