Class: Atatus::Config::Options::Option Private
- Inherits:
-
Object
- Object
- Atatus::Config::Options::Option
- Defined in:
- lib/atatus/config/options.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #converter ⇒ Object readonly private
- #default ⇒ Object readonly private
- #key ⇒ Object readonly private
- #type ⇒ Object readonly private
- #value ⇒ Object private
Instance Method Summary collapse
- #env_key ⇒ Object private
-
#initialize(key, value: nil, type: :string, default: nil, converter: nil) ⇒ Option
constructor
private
A new instance of Option.
- #set(value) ⇒ Object private
Constructor Details
#initialize(key, value: nil, type: :string, default: nil, converter: nil) ⇒ Option
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Option.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/atatus/config/options.rb', line 26 def initialize( key, value: nil, type: :string, default: nil, converter: nil ) @key = key @type = type @default = default @converter = converter set(value || default) end |
Instance Attribute Details
#converter ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/config/options.rb', line 41 def converter @converter end |
#default ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/config/options.rb', line 41 def default @default end |
#key ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/config/options.rb', line 41 def key @key end |
#type ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/config/options.rb', line 41 def type @type end |
#value ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/atatus/config/options.rb', line 42 def value @value end |
Instance Method Details
#env_key ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 |
# File 'lib/atatus/config/options.rb', line 48 def env_key "ATATUS_#{key.upcase}" end |
#set(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 |
# File 'lib/atatus/config/options.rb', line 44 def set(value) @value = normalize(value) end |