Sha256: 456e02c4f260886fa1c118c458bd96787e51a2fa7844d7205a366513ff2188b7

Contents?: true

Size: 532 Bytes

Versions: 7

Compression:

Stored size: 532 Bytes

Contents

module POI
  class NamedRange
  
    # takes an instance of org.apache.poi.ss.usermodel.Name, and a POI::Workbook
    def initialize name, workbook
      @name = name
      @workbook = workbook
    end
  
    def name
      @name.name_name
    end
  
    def sheet
      @workbook.worksheets[@name.sheet_name]
    end
  
    def formula
      @name.refers_to_formula
    end
  
    def cells
      @name.is_deleted ? [] : [@workbook.cell(formula)].flatten
    end
  
    def values
      cells.collect{|c| c.value}
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
jruby-poi-1.0.0 lib/poi/workbook/named_range.rb
timcharper-jruby-poi-0.9.1 lib/poi/workbook/named_range.rb
jruby-poi-0.9.0 lib/poi/workbook/named_range.rb
nurettin-jruby-poi-0.8.2 lib/poi/workbook/named_range.rb
jruby-poi-0.8.2 lib/poi/workbook/named_range.rb
jruby-poi-0.7.2 lib/poi/workbook/named_range.rb
jruby-poi-0.7.1 lib/poi/workbook/named_range.rb