Sha256: fb7b607a623e9c5a2882b0eb3c92f324ff723929dba5c836328f258fe7913c2a

Contents?: true

Size: 449 Bytes

Versions: 4

Compression:

Stored size: 449 Bytes

Contents

module ExcelAbstraction
  class Row
    include Enumerable
    extend Forwardable

    attr_accessor :styles
    delegate [:each] => :cells

    alias :first :min
    alias :last :max

    def initialize
      @cells = []
      @styles = {}
    end

    def [](index)
      find { |cell| cell.position == index }
    end

    def <<(attrs)
      @cells << ExcelAbstraction::Cell.new(attrs)
    end

    protected

    attr_accessor :cells
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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