Class: AttrTypecastable::Types::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/attr_typecastable/types/base.rb

Instance Method Summary collapse

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)
  @options = 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