CSV::Cell (Class)

In: csv.rb
Parent: Object

Describes a cell of CSV.

Methods

==   match   new   to_s   to_str  

Attributes

data  [RW]  Datum as string.
is_null  [RW]  Is this datum NULL?

Public Class methods

If is_null is true, datum is stored in the instance created but it should be treated as ‘NULL’.

[Source]

# File csv.rb, line 22
    def initialize(data = '', is_null = true)
      @data = data
      @is_null = is_null
    end

Public Instance methods

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.

[Source]

# 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.

[Source]

# 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

[Source]

# File csv.rb, line 55
    def to_s
      content.to_s
    end

[Source]

# File csv.rb, line 51
    def to_str
      content.to_str
    end

[Validate]