Class: Hanami::CLI::Repl::Core Private
- Inherits:
-
Object
- Object
- Hanami::CLI::Repl::Core
- Defined in:
- lib/hanami/cli/repl/core.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #app ⇒ Object readonly private
- #opts ⇒ Object readonly private
Instance Method Summary collapse
- #context ⇒ Object private
- #env ⇒ Object private
- #inflector ⇒ Object private
-
#initialize(app, opts) ⇒ Core
constructor
private
A new instance of Core.
- #name ⇒ Object private
- #prompt ⇒ Object private
- #start ⇒ Object private
Constructor Details
#initialize(app, opts) ⇒ Core
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 Core.
19 20 21 22 |
# File 'lib/hanami/cli/repl/core.rb', line 19 def initialize(app, opts) @app = app @opts = opts end |
Instance Attribute Details
#app ⇒ Object (readonly)
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.
14 15 16 |
# File 'lib/hanami/cli/repl/core.rb', line 14 def app @app end |
#opts ⇒ Object (readonly)
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.
15 16 17 |
# File 'lib/hanami/cli/repl/core.rb', line 15 def opts @opts end |
Instance Method Details
#context ⇒ Object
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.
32 33 34 |
# File 'lib/hanami/cli/repl/core.rb', line 32 def context @context ||= Hanami::Console::Context.new(app) end |
#env ⇒ Object
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.
51 52 53 |
# File 'lib/hanami/cli/repl/core.rb', line 51 def env app.container.env end |
#inflector ⇒ Object
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.
57 58 59 |
# File 'lib/hanami/cli/repl/core.rb', line 57 def inflector app.inflector end |
#name ⇒ Object
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.
44 45 46 47 |
# File 'lib/hanami/cli/repl/core.rb', line 44 def name (app.container.config.name || inflector.underscore(app.name)) .to_s.split("/")[0] end |
#prompt ⇒ Object
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.
38 39 40 |
# File 'lib/hanami/cli/repl/core.rb', line 38 def prompt "#{name}[#{env}]" end |
#start ⇒ Object
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.
26 27 28 |
# File 'lib/hanami/cli/repl/core.rb', line 26 def start raise Hanami::CLI::NotImplementedError end |