Class: UCD::AttributeParser
- Inherits:
-
Parslet::Parser
- Object
- Parslet::Parser
- UCD::AttributeParser
- Defined in:
- lib/ucd/attribute_parser.rb
Defined Under Namespace
Classes: Transform
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.parse(io, options = {}) ⇒ Object
12 13 14 |
# File 'lib/ucd/attribute_parser.rb', line 12 def self.parse(io, ={}) new.parse(io, ) end |
Instance Method Details
#parse(io, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/ucd/attribute_parser.rb', line 16 def parse(io, ={}) tree = Transform.new.apply(super) tree = tree[:assignments].each_with_object({}) { |assignment, memo| memo[assignment[:name].to_s] = assignment[:value] } tree end |