Class: Runbook::Statements::Ask

Inherits:
Runbook::Statement show all
Defined in:
lib/runbook/statements/ask.rb

Instance Attribute Summary collapse

Attributes inherited from Runbook::Statement

#parent

Instance Method Summary collapse

Methods inherited from Runbook::Statement

#render, #run

Methods included from Hooks::Invoker

#_execute_after_hooks, #_execute_around_hooks, #_execute_before_hooks, #invoke_with_hooks

Methods inherited from Node

#dynamic!, #dynamic?, #visited!, #visited?

Constructor Details

#initialize(prompt, into:, default: nil, echo: true) ⇒ Ask

Returns a new instance of Ask.



5
6
7
8
9
10
# File 'lib/runbook/statements/ask.rb', line 5

def initialize(prompt, into:, default: nil, echo: true)
  @prompt = prompt
  @into = into
  @default = default
  @echo = echo
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



3
4
5
# File 'lib/runbook/statements/ask.rb', line 3

def default
  @default
end

#echoObject (readonly)

Returns the value of attribute echo.



3
4
5
# File 'lib/runbook/statements/ask.rb', line 3

def echo
  @echo
end

#intoObject (readonly)

Returns the value of attribute into.



3
4
5
# File 'lib/runbook/statements/ask.rb', line 3

def into
  @into
end

#promptObject (readonly)

Returns the value of attribute prompt.



3
4
5
# File 'lib/runbook/statements/ask.rb', line 3

def prompt
  @prompt
end