Class: Dry::Configurable::Config::Value

Inherits:
Object
  • Object
show all
Defined in:
lib/dry/configurable/config/value.rb

Constant Summary collapse

NONE =
::Object.new.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)



9
10
11
# File 'lib/dry/configurable/config/value.rb', line 9

def name
  @name
end

#processorObject (readonly)



9
10
11
# File 'lib/dry/configurable/config/value.rb', line 9

def processor
  @processor
end

Instance Method Details

#none?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dry/configurable/config/value.rb', line 21

def none?
  @value.equal?(::Dry::Configurable::Config::Value::NONE)
end

#valueObject



17
18
19
# File 'lib/dry/configurable/config/value.rb', line 17

def value
  none? ? nil : @value
end