Class: Dry::Configurable::Config::Value
- Inherits:
-
Object
- Object
- Dry::Configurable::Config::Value
- Defined in:
- lib/dry/configurable/config/value.rb
Constant Summary collapse
- NONE =
::Object.new.freeze
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #processor ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(name, value, processor) ⇒ Value
constructor
A new instance of Value.
- #none? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(name, value, processor) ⇒ Value
Returns a new instance of Value.
11 12 13 14 15 |
# File 'lib/dry/configurable/config/value.rb', line 11 def initialize(name, value, processor) @name = name.to_sym @value = value @processor = processor end |
Instance Attribute Details
#name ⇒ Object (readonly)
9 10 11 |
# File 'lib/dry/configurable/config/value.rb', line 9 def name @name end |
#processor ⇒ Object (readonly)
9 10 11 |
# File 'lib/dry/configurable/config/value.rb', line 9 def processor @processor end |
Instance Method Details
#none? ⇒ Boolean
21 22 23 |
# File 'lib/dry/configurable/config/value.rb', line 21 def none? @value.equal?(::Dry::Configurable::Config::Value::NONE) end |
#value ⇒ Object
17 18 19 |
# File 'lib/dry/configurable/config/value.rb', line 17 def value none? ? nil : @value end |