Class: ActiveZuora::IntegerField

Inherits:
Field
  • Object
show all
Defined in:
lib/active_zuora/fields/integer_field.rb

Instance Attribute Summary

Attributes inherited from Field

#default, #name, #namespace, #zuora_name

Instance Method Summary collapse

Methods inherited from Field

#build_xml, #clear_changed_attributes, #define_instance_methods, #initialize

Constructor Details

This class inherits a constructor from ActiveZuora::Field

Instance Method Details

#type_cast(value) ⇒ Object


4
5
6
7
8
# File 'lib/active_zuora/fields/integer_field.rb', line 4

def type_cast(value)
  return value if value.nil? || value.is_a?(Integer)
  return value.to_i if value.respond_to?(:to_i)
  default
end