Class: RuboCounsel::ScalarAttribute

Inherits:
ConfigurableAttribute show all
Defined in:
lib/rubocounsel/configurable_attribute.rb

Instance Attribute Summary

Attributes inherited from ConfigurableAttribute

#default_value, #examples, #name, #options

Instance Method Summary collapse

Methods inherited from ConfigurableAttribute

#boolean?, #choice?, for, #has_examples?, #initialize, #promptable?

Constructor Details

This class inherits a constructor from RuboCounsel::ConfigurableAttribute

Instance Method Details

#prompt(output: $stdout) ⇒ Object



105
106
107
108
109
110
# File 'lib/rubocounsel/configurable_attribute.rb', line 105

def prompt(output: $stdout)
  ::CLI::UI::Prompt.ask(
    "#{@name}? (default: #{@default_value})",
    default: @default_value.to_s
  )
end