Module: EnvironmentHelpers::NumericHelpers

Included in:
EnvironmentHelpers
Defined in:
lib/environment_helpers/numeric_helpers.rb

Instance Method Summary collapse

Instance Method Details

#integer(name, default: nil, required: false) ⇒ Object



3
4
5
6
7
# File 'lib/environment_helpers/numeric_helpers.rb', line 3

def integer(name, default: nil, required: false)
  check_default_type(:integer, default, Integer)
  text = fetch_value(name, required: required)
  text&.to_i || default
end