Class: Rupert::Parser
- Inherits:
-
Object
- Object
- Rupert::Parser
- Defined in:
- lib/rupert/parser.rb
Instance Method Summary collapse
-
#initialize(raw_io) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(raw_io) ⇒ Parser
Returns a new instance of Parser.
6 7 8 |
# File 'lib/rupert/parser.rb', line 6 def initialize(raw_io) @raw_io = raw_io end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rupert/parser.rb', line 10 def parse # TODO Fit to current design (i.e. no parsing in Lead c'tor?) lead = RPM::Lead.new(@raw_io) entry_count, store_size = parse_header entries = parse_entries(entry_count) store = parse_store(store_size) content = parse_content signature = RPM::Signature.new(RPM::Signature::Index.new(entries, store)) RPM.new(lead, signature, content) end |