Sha256: 2e656db220ffd6b5efcda89b16a61ba2647a4f2589829a9dd1e9d42fef7913f0

Contents?: true

Size: 600 Bytes

Versions: 4

Compression:

Stored size: 600 Bytes

Contents

module ExcelAbstraction
  class Cell
    attr_reader :position, :val, :styles

    def initialize(attrs = {})
      @position = Integer(attrs.fetch(:position) { raise ArgumentError.new("Position absent for ExcelAbstraction cell") })
      @val = attrs.fetch(:val) { raise ArgumentError.new("Value absent for ExcelAbstraction cell") }
      @styles = attrs.fetch(:styles) { {} }
    end

    def <=>(other)
      position <=> other.position
    end

    def ==(other)
      position == other.position && val == other.val && styles == other.styles
    end

    def to_cell
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
excel_templating-0.4.2 lib/excel_templating/excel_abstraction/cell.rb
excel_templating-0.4.1 lib/excel_templating/excel_abstraction/cell.rb
excel_templating-0.4.0 lib/excel_templating/excel_abstraction/cell.rb
excel_templating-0.3.2 lib/excel_templating/excel_abstraction/cell.rb