Class: POI::NamedRange
- Inherits:
-
Object
- Object
- POI::NamedRange
- Defined in:
- lib/poi/workbook/named_range.rb
Instance Method Summary collapse
- #cells ⇒ Object
- #formula ⇒ Object
-
#initialize(name, workbook) ⇒ NamedRange
constructor
takes an instance of org.apache.poi.ss.usermodel.Name, and a POI::Workbook.
- #name ⇒ Object
- #sheet ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(name, workbook) ⇒ NamedRange
takes an instance of org.apache.poi.ss.usermodel.Name, and a POI::Workbook
5 6 7 8 |
# File 'lib/poi/workbook/named_range.rb', line 5 def initialize name, workbook @name = name @workbook = workbook end |
Instance Method Details
#cells ⇒ Object
22 23 24 |
# File 'lib/poi/workbook/named_range.rb', line 22 def cells @name.is_deleted ? [] : [@workbook.cell(formula)].flatten end |
#formula ⇒ Object
18 19 20 |
# File 'lib/poi/workbook/named_range.rb', line 18 def formula @name.refers_to_formula end |
#name ⇒ Object
10 11 12 |
# File 'lib/poi/workbook/named_range.rb', line 10 def name @name.name_name end |
#sheet ⇒ Object
14 15 16 |
# File 'lib/poi/workbook/named_range.rb', line 14 def sheet @workbook.worksheets[@name.sheet_name] end |
#values ⇒ Object
26 27 28 |
# File 'lib/poi/workbook/named_range.rb', line 26 def values cells.collect{|c| c.value} end |