Class: AttrTypecastable::Types::Base
- Inherits:
-
Object
- Object
- AttrTypecastable::Types::Base
- Defined in:
- lib/attr_typecastable/types/base.rb
Direct Known Subclasses
ArrayBase, BigDecimal, Boolean, Date, DateTime, Float, Integer, Object, Rational, String, Symbol, Time
Instance Method Summary collapse
-
#initialize(**options) ⇒ Base
constructor
A new instance of Base.
- #typecast(value) ⇒ Object
Constructor Details
#initialize(**options) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/attr_typecastable/types/base.rb', line 4 def initialize(**) @options = end |
Instance Method Details
#typecast(value) ⇒ Object
8 9 10 11 |
# File 'lib/attr_typecastable/types/base.rb', line 8 def typecast(value) return nil if allow_nil_and_nil_value?(value) do_typecast(value) end |