Class: Hoss::Config::Options::Option Private
- Inherits:
-
Object
- Object
- Hoss::Config::Options::Option
- Defined in:
- lib/hoss/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
- #default ⇒ Object readonly private
- #key ⇒ Object readonly private
- #type ⇒ Object readonly private
- #value ⇒ Object readonly 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/hoss/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
#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/hoss/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/hoss/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/hoss/config/options.rb', line 41 def type @type end |
#value ⇒ 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/hoss/config/options.rb', line 41 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.
47 48 49 |
# File 'lib/hoss/config/options.rb', line 47 def env_key "HOSS_#{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.
43 44 45 |
# File 'lib/hoss/config/options.rb', line 43 def set(value) @value = normalize(value) end |