Class: ContainerConfig::Coercer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/container_config/coercer/base.rb

Overview

Base type coercer

Instance Method Summary collapse

Instance Method Details

#coerce(_value) ⇒ Object

Coerces the given value into the coercer type

Parameters:

  • _value (Object)

    given value

Returns:

  • (Object)

    coerced value

Raises:



34
35
36
# File 'lib/container_config/coercer/base.rb', line 34

def coerce(_value)
  raise ContainerConfig::MissingOverride, "Must override coerce method in derived class #{self.class}"
end

#nameString

Returns name of the coercer

Returns:

Raises:



12
13
14
# File 'lib/container_config/coercer/base.rb', line 12

def name
  raise ContainerConfig::MissingOverride, "Must override name method in derived class #{self.class}"
end

#typeSymbol

Returns the type of the coercer This is used by the ContainerConfig::Coercer.coerce_value method to determine whether this coercer should be used for a given type

Returns:

Raises:



23
24
25
# File 'lib/container_config/coercer/base.rb', line 23

def type
  raise ContainerConfig::MissingOverride, "Must override type method in derived class #{self.class}"
end