Module: EnvironmentHelpers::StringHelpers
- Included in:
- EnvironmentHelpers
- Defined in:
- lib/environment_helpers/string_helpers.rb
Instance Method Summary collapse
- #string(name, default: nil, required: false) ⇒ Object
- #symbol(name, default: nil, required: false) ⇒ Object
Instance Method Details
#string(name, default: nil, required: false) ⇒ Object
3 4 5 |
# File 'lib/environment_helpers/string_helpers.rb', line 3 def string(name, default: nil, required: false) fetch_value(name, required: required) || default end |
#symbol(name, default: nil, required: false) ⇒ Object
7 8 9 10 |
# File 'lib/environment_helpers/string_helpers.rb', line 7 def symbol(name, default: nil, required: false) check_default_type(:symbol, default, Symbol) string(name, default: default&.to_s, required: required)&.to_sym end |