Class: AttrCoerced::Coercer
- Inherits:
-
Struct
- Object
- Struct
- AttrCoerced::Coercer
- Defined in:
- lib/attr_coerced/coercer.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default
6 7 8 |
# File 'lib/attr_coerced/coercer.rb', line 6 def default @default end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/attr_coerced/coercer.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value
6 7 8 |
# File 'lib/attr_coerced/coercer.rb', line 6 def value @value end |
Class Method Details
.get(*args) ⇒ Object
8 9 10 |
# File 'lib/attr_coerced/coercer.rb', line 8 def self.get(*args) new(*args).get end |
Instance Method Details
#get ⇒ Object
12 13 14 |
# File 'lib/attr_coerced/coercer.rb', line 12 def get coerce(value) || coerce(default) end |