Module: ServiceActor::Promptable::ClassMethods
- Defined in:
- lib/service_actor/promptable.rb
Overview
DSL for specifying the prompt
Instance Method Summary collapse
- #inherited(child) ⇒ Object
- #prompt ⇒ Object
- #prompt=(prompter) ⇒ Object
- #prompt_with(prompter, unattended_options: {}) ⇒ Object
- #unattended_options ⇒ Object
- #unattended_options=(unattended_options) ⇒ Object
Instance Method Details
#inherited(child) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/service_actor/promptable.rb', line 36 def inherited(child) super child.prompt_with( prompt, unattended_options: ServiceActor::Promptable::UNATTENDED_DEFAULTS.merge().dup ) end |
#prompt ⇒ Object
55 56 57 |
# File 'lib/service_actor/promptable.rb', line 55 def prompt @prompt end |
#prompt=(prompter) ⇒ Object
59 60 61 |
# File 'lib/service_actor/promptable.rb', line 59 def prompt=(prompter) @prompt = prompter end |
#prompt_with(prompter, unattended_options: {}) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/service_actor/promptable.rb', line 45 def prompt_with(prompter, unattended_options: {}) = ServiceActor::Promptable::UNATTENDED_DEFAULTS.merge() self.prompt = prompter self. = return unless .key?(:prompt_toggle) && [:prompt_toggle].is_a?(Symbol) # Create an Actor input :unattended (default) which must be either true or false input [:prompt_toggle], in: [true, false], allow_nil: false, default: false end |
#unattended_options ⇒ Object
63 64 65 |
# File 'lib/service_actor/promptable.rb', line 63 def @unattended_options end |
#unattended_options=(unattended_options) ⇒ Object
67 68 69 |
# File 'lib/service_actor/promptable.rb', line 67 def () @unattended_options = end |