Class: SdbDal::IsNullTransform
- Inherits:
-
Object
- Object
- SdbDal::IsNullTransform
- Defined in:
- lib/sdb_dal/is_null_transform.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#source_column ⇒ Object
Returns the value of attribute source_column.
Instance Method Summary collapse
-
#initialize(source_column) ⇒ IsNullTransform
constructor
A new instance of IsNullTransform.
- #transform(value) ⇒ Object
Constructor Details
#initialize(source_column) ⇒ IsNullTransform
Returns a new instance of IsNullTransform.
6 7 8 9 |
# File 'lib/sdb_dal/is_null_transform.rb', line 6 def initialize(source_column ) self.source_column =source_column self.name = "#{name}_is_null".to_sym end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/sdb_dal/is_null_transform.rb', line 4 def name @name end |
#source_column ⇒ Object
Returns the value of attribute source_column.
5 6 7 |
# File 'lib/sdb_dal/is_null_transform.rb', line 5 def source_column @source_column end |
Instance Method Details
#transform(value) ⇒ Object
10 11 12 |
# File 'lib/sdb_dal/is_null_transform.rb', line 10 def transform(value) value.nil?.to_s end |