Class: Hanami::Config::Console
- Inherits:
-
Object
- Object
- Hanami::Config::Console
- Includes:
- Dry::Configurable
- Defined in:
- lib/hanami/config/console.rb
Overview
Hanami console config
Instance Attribute Summary collapse
-
#engine ⇒ Symbol
Sets or returns the interactive console engine to be used by ‘hanami console`.
Instance Method Summary collapse
-
#extensions ⇒ Array<Module>
Returns the complete list of extensions to be used in the console.
-
#include(*mod) ⇒ void
Define a module extension to be included in the console.
-
#initialize ⇒ Console
constructor
private
A new instance of Console.
Constructor Details
#initialize ⇒ Console
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Console.
54 55 56 |
# File 'lib/hanami/config/console.rb', line 54 def initialize @extensions = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
66 67 68 69 70 71 72 |
# File 'lib/hanami/config/console.rb', line 66 def method_missing(name, *args, &block) if config.respond_to?(name) config.public_send(name, *args, &block) else super end end |
Instance Attribute Details
#engine ⇒ Symbol
Sets or returns the interactive console engine to be used by ‘hanami console`. Supported values are `:irb` (default) and `:pry`.
25 |
# File 'lib/hanami/config/console.rb', line 25 setting :engine, default: :irb |
Instance Method Details
#extensions ⇒ Array<Module>
Returns the complete list of extensions to be used in the console
40 |
# File 'lib/hanami/config/console.rb', line 40 def extensions = @extensions.dup.freeze |
#include(*mod) ⇒ void
This method returns an undefined value.
Define a module extension to be included in the console
49 50 51 |
# File 'lib/hanami/config/console.rb', line 49 def include(*mod) @extensions.concat(mod).uniq! end |