Class: Strict::Parameter

Inherits:
Declaration show all
Defined in:
lib/strict/parameter.rb

Constant Summary

Constants inherited from Declaration

Declaration::NOT_PROVIDED

Instance Attribute Summary

Attributes inherited from Declaration

#coercer, #default_generator, #name, #validator

Instance Method Summary collapse

Methods inherited from Declaration

#initialize, make, #optional?, #valid?, #violations

Constructor Details

This class inherits a constructor from Strict::Declaration

Instance Method Details

#coerce(value) ⇒ Object



13
14
15
16
17
# File 'lib/strict/parameter.rb', line 13

def coerce(value)
  return value unless coercer

  coercer.call(value)
end