In: |
csv.rb
|
Parent: | Object |
DESCRIPTION
CSV::Cell -- Describes 1 cell of CSV.
data | [RW] | Datum as string. |
is_null | [RW] | Is this datum null? |
SYNOPSIS
cell = CSV::Cell.new(data = '', is_null = true)
ARGS
data: datum as String is_null: is this datum null?
RETURNS
cell: Created instance.
DESCRIPTION
Create instance. If is_null is true, datum is stored in the instance created but it should be treated as 'NULL'.
# File csv.rb, line 38 def initialize(data = '', is_null = true) @data = data @is_null = is_null end
SYNOPSIS
CSV::Cell#match(rhs)
ARGS
rhs: an instance of CSV::Cell to be compared.
RETURNS
true/false. See the souce if you want to know matching algorithm.
DESCRIPTION
Compare another cell with me. Bare in mind Null matches with Null using this method. Use CSV::Cell#== if you want Null never matches with other data including Null.
# File csv.rb, line 57 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
SYNOPSIS
CSV::Cell#==(rhs)
ARGS
rhs: an instance of CSV::Cell to be compared.
RETURNS
true/false. See the souce if you want to know matching algorithm.
DESCRIPTION
Compare another cell with me. Bare in mind Null is not match with Null using this method. Null never matches with other data including Null. Use CSV::Cell#match if you want Null matches with Null.
# File csv.rb, line 81 def ==(rhs) if @is_null or rhs.is_null false else @data == rhs.data end end