Class: GitPrepareBranch::Configurator
- Inherits:
-
Object
- Object
- GitPrepareBranch::Configurator
- Defined in:
- lib/git-prepare-branch/configurator.rb
Defined Under Namespace
Classes: ScreenDSL
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #apply(&block) ⇒ Object
-
#initialize(app) ⇒ Configurator
constructor
A new instance of Configurator.
- #on(event, &block) ⇒ Object
- #routing(routes) ⇒ Object
- #screen(name, &block) ⇒ Object
- #title(value) ⇒ Object
- #variable(name, capture: nil, value: nil) ⇒ Object
Constructor Details
#initialize(app) ⇒ Configurator
Returns a new instance of Configurator.
9 10 11 |
# File 'lib/git-prepare-branch/configurator.rb', line 9 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/git-prepare-branch/configurator.rb', line 7 def app @app end |
Instance Method Details
#apply(&block) ⇒ Object
13 14 15 |
# File 'lib/git-prepare-branch/configurator.rb', line 13 def apply(&block) instance_exec(&block) end |
#on(event, &block) ⇒ Object
17 18 19 |
# File 'lib/git-prepare-branch/configurator.rb', line 17 def on(event, &block) app.add_event_handler event, &block end |
#routing(routes) ⇒ Object
21 22 23 |
# File 'lib/git-prepare-branch/configurator.rb', line 21 def routing(routes) @app.router = routes end |
#screen(name, &block) ⇒ Object
25 26 27 |
# File 'lib/git-prepare-branch/configurator.rb', line 25 def screen(name, &block) app.add_screen ScreenDSL.new(Screen.new(name)).apply(&block).screen end |
#title(value) ⇒ Object
29 30 31 |
# File 'lib/git-prepare-branch/configurator.rb', line 29 def title(value) app.title = value end |
#variable(name, capture: nil, value: nil) ⇒ Object
33 34 35 |
# File 'lib/git-prepare-branch/configurator.rb', line 33 def variable(name, capture: nil, value: nil) app.add_variable name, capture: capture, value: value end |