Class: Lutaml::Uml::Parsers::Attribute

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/lutaml/uml/parsers/attribute.rb

Defined Under Namespace

Classes: Transform

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(io, options = {}) ⇒ Object



15
16
17
# File 'lib/lutaml/uml/parsers/attribute.rb', line 15

def self.parse(io, options = {})
  new.parse(io, options)
end

Instance Method Details

#parse(io, options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/lutaml/uml/parsers/attribute.rb', line 19

def parse(io, options = {})
  tree = Transform.new.apply(super)
  tree[:assignments].to_h do |assignment|
    [assignment[:name].to_s, assignment[:value]]
  end
end