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.
120 121 122 123 |
# File 'lib/action_set/attribute_value.rb', line 120 def initialize(raw, target) @raw = raw @target = target end |
Instance Method Details
#process ⇒ Object
125 126 127 128 129 130 131 |
# File 'lib/action_set/attribute_value.rb', line 125 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 |