Class: Unxls::Parser
- Inherits:
-
Object
- Object
- Unxls::Parser
- Defined in:
- lib/unxls/map.rb,
lib/unxls/parser.rb
Overview
Opens the compound file and parses the needed storages and streams (2.1.7)
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
-
#initialize(file, settings) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Hash
Constructor Details
#initialize(file, settings) ⇒ Parser
Returns a new instance of Parser.
10 11 12 13 |
# File 'lib/unxls/parser.rb', line 10 def initialize(file, settings) @file = file @settings = settings end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/unxls/parser.rb', line 5 def file @file end |
#settings ⇒ Object
Returns the value of attribute settings.
6 7 8 |
# File 'lib/unxls/parser.rb', line 6 def settings @settings end |
Instance Method Details
#parse ⇒ Hash
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/unxls/parser.rb', line 16 def parse biff_version = detect_biff_version result = {} case biff_version when :BIFF8 result[:workbook_stream] = Unxls::Biff8::WorkbookStream.new(self).parse # parse other storages/streams else raise "Sorry, #{biff_version} is not supported yet" end result end |