Class: Fvm::Parser
- Inherits:
-
Object
- Object
- Fvm::Parser
- Defined in:
- lib/fvm/parser.rb
Overview
Provides methods for parsing a Flex SDK download page into usable data structures.
At the moment, Flex SDK download pages list all table headers and bodies in-line
as siblings so there is no association between a given table's header and body
except that they are in-order. For the time being, this parser rests on
this assumption.
Constant Summary collapse
- HEADER_XPATH =
The xpath for table headers
'//h3'
- TABLE_XPATH =
The xpath for table bodies
'//div[@class="table-wrap"]'
Instance Method Summary collapse
-
#parse(page) ⇒ Object
Parses a Flex SDK download page into a hash.
Instance Method Details
#parse(page) ⇒ Object
Parses a Flex SDK download page into a hash
23 24 25 26 27 28 29 |
# File 'lib/fvm/parser.rb', line 23 def parse( page ) { }.tap do |result| sections_for( page ).each do |title, table| result[ format.title title ] = format.table table end end end |