Class: Rundoc::PegTransformer

Inherits:
Parslet::Transform
  • Object
show all
Defined in:
lib/rundoc/peg_parser.rb

Defined Under Namespace

Classes: TransformError, Visability

Class Method Summary collapse

Class Method Details

.convert_named_args(na) ⇒ Object



180
181
182
183
184
185
186
# File 'lib/rundoc/peg_parser.rb', line 180

def self.convert_named_args(na)
  (na.is_a?(Array) ? na : [na]).each_with_object({}) { |element, hash|
    key = element[:key_value][:key].to_sym
    val = element[:key_value][:val]
    hash[key] = val
  }
end