Class: ActionSet::AttributeValue::BooleanAdapter
- Inherits:
-
Object
- Object
- ActionSet::AttributeValue::BooleanAdapter
- Defined in:
- lib/action_set/attribute_value.rb
Instance Method Summary collapse
-
#initialize(raw, target) ⇒ BooleanAdapter
constructor
A new instance of BooleanAdapter.
- #process ⇒ Object
Constructor Details
#initialize(raw, target) ⇒ BooleanAdapter
Returns a new instance of BooleanAdapter.
126 127 128 129 |
# File 'lib/action_set/attribute_value.rb', line 126 def initialize(raw, target) @raw = raw @target = target end |
Instance Method Details
#process ⇒ Object
131 132 133 134 135 136 137 |
# File 'lib/action_set/attribute_value.rb', line 131 def process return if @raw.is_a? @target return unless @target.eql?(TrueClass) || @target.eql?(FalseClass) # ActiveModel::Type::Boolean is too expansive in its casting; will get false positives to_bool end |