Sha256: 9485c5e51516702f149233c020a0d5bd9a5ea57fffa09984086327a7984b00d4

Contents?: true

Size: 286 Bytes

Versions: 30

Compression:

Stored size: 286 Bytes

Contents

module ActiveZuora
  class BooleanField < Field
    
    def type_cast(value)
      return value if value.is_a?(TrueClass) || value.is_a?(FalseClass)
      return true if value.to_s.downcase == 'true'
      return false if value.to_s.downcase == 'false'
      default
    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
active_zuora-2.6.0 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.5.4 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.5.3 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.5.2 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.5.1 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.5.0 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.4.1 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.4.0 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.3.1 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.3.0 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.7 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.6 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.5 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.4 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.3 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.2 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.1 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.2.0 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.1.4 lib/active_zuora/fields/boolean_field.rb
active_zuora-2.1.3 lib/active_zuora/fields/boolean_field.rb