In: |
csv.rb
|
Parent: | Object |
Describes a cell of CSV.
data | [RW] | Datum as string. |
is_null | [RW] | Is this datum NULL? |
If is_null is true, datum is stored in the instance created but it should be treated as ‘NULL’.
# File csv.rb, line 22 def initialize(data = '', is_null = true) @data = data @is_null = is_null end
Compares another cell with self. Bear in mind NULL does not match with NULL. Use CSV::Cell#match if you want NULL matches with NULL. rhs: an instance of CSV::Cell to be compared.
# File csv.rb, line 43 def ==(rhs) if @is_null or rhs.is_null false else @data == rhs.data end end
Compares another cell with self. Bear in mind NULL matches with NULL. Use CSV::Cell#== if you don’t want NULL matches with NULL. rhs: an instance of CSV::Cell to be compared.
# File csv.rb, line 30 def match(rhs) if @is_null and rhs.is_null true elsif @is_null or rhs.is_null false else @data == rhs.data end end