lib/scaffold_parser/scaffolders/xsd.rb in scaffold_parser-0.4.0 vs lib/scaffold_parser/scaffolders/xsd.rb in scaffold_parser-0.5.0

- old
+ new

@@ -22,11 +22,11 @@ code = unscaffolded_elements.flat_map do |element| [Parser.call(element.definition, @options), Builder.call(element.definition, @options)] end - code.push ['parsers/base_parser.rb', base_element_template] + code.push ['parsers/base_parser.rb', base_parser_template] code.push ['builders/base_builder.rb', base_builder_template] end private @@ -46,11 +46,11 @@ end collected end - def base_element_template + def base_parser_template <<~TEMPLATE module Parsers module BaseParser EMPTY_ARRAY = [] @@ -70,12 +70,10 @@ return nil if raw.nil? element = raw.locate(locator.to_s).first if element - text = WithAttributes.new(element.text) - text.attributes = element.attributes - text + StringWithAttributes.new(element.text, element.attributes) end end def has?(locator) raw.locate(locator).any?