Module: CLI::DSL::Value
Instance Method Summary collapse
- #default ⇒ Object
- #default_cast ⇒ Object
- #default_label ⇒ Object
- #has_default? ⇒ Boolean
- #has_default_label? ⇒ Boolean
- #mandatory? ⇒ Boolean
Instance Method Details
#default ⇒ Object
56 57 58 |
# File 'lib/cli/dsl.rb', line 56 def default @options[:default].to_s end |
#default_cast ⇒ Object
60 61 62 |
# File 'lib/cli/dsl.rb', line 60 def default_cast cast(default) end |
#default_label ⇒ Object
68 69 70 |
# File 'lib/cli/dsl.rb', line 68 def default_label @options[:default_label].to_s end |
#has_default? ⇒ Boolean
64 65 66 |
# File 'lib/cli/dsl.rb', line 64 def has_default? @options.member? :default end |
#has_default_label? ⇒ Boolean
72 73 74 |
# File 'lib/cli/dsl.rb', line 72 def has_default_label? @options.member? :default_label end |
#mandatory? ⇒ Boolean
76 77 78 |
# File 'lib/cli/dsl.rb', line 76 def mandatory? not has_default? and @options[:required] end |