Class: Lafcadio::IntegerField

Inherits:
ObjectField show all
Defined in:
lib/lafcadio/objectField.rb

Overview

IntegerField represents an integer.

Direct Known Subclasses

PrimaryKeyField

Instance Attribute Summary

Attributes inherited from ObjectField

#db_field_name, #domain_class, #mock_value, #name, #not_nil

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ObjectField

#<=>, #bind_write?, create_from_xml, create_with_args, creation_parameters, #db_column, #db_will_automatically_write?, #default_mock_value, #initialize, #prev_value, #process_before_verify, #value_for_sql, value_type, #verify, #verify_non_nil_value

Constructor Details

This class inherits a constructor from Lafcadio::ObjectField

Class Method Details

.mock_valueObject

:nodoc:



312
313
314
# File 'lib/lafcadio/test.rb', line 312

def IntegerField.mock_value #:nodoc:
	1
end

Instance Method Details

#value_from_sql(string) ⇒ Object



145
146
147
148
# File 'lib/lafcadio/objectField.rb', line 145

def value_from_sql(string)
	value = super
	value ? value.to_i : nil
end