Class: Ods::File
- Inherits:
-
Object
- Object
- Ods::File
- Defined in:
- lib/ods/file.rb
Constant Summary collapse
- XPATH_SHEETS =
'//office:body/office:spreadsheet/table:table'
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ File
constructor
A new instance of File.
- #sheets ⇒ Object
Constructor Details
#initialize(path) ⇒ File
19 20 21 |
# File 'lib/ods/file.rb', line 19 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
17 18 19 |
# File 'lib/ods/file.rb', line 17 def path @path end |
Class Method Details
.open(path) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ods/file.rb', line 8 def self.open(path) ods_file = new(path) if block_given? yield ods_file else ods_file end end |
Instance Method Details
#sheets ⇒ Object
23 24 25 |
# File 'lib/ods/file.rb', line 23 def sheets content.root.xpath(XPATH_SHEETS).map {|sheet| Sheet.new(sheet) } end |