Class: WikiAvro::XML::Inserter

Inherits:
Leaf show all
Defined in:
lib/wikiavro/xml.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#attr

Instance Method Summary collapse

Methods inherited from Element

#optional?, #parse

Constructor Details

#initialize(name, target = name) ⇒ Inserter

Returns a new instance of Inserter.



193
194
195
196
197
# File 'lib/wikiavro/xml.rb', line 193

def initialize(name, target=name)
  super()
  @name = name
  @writer = (target + '=').to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



184
185
186
# File 'lib/wikiavro/xml.rb', line 184

def name
  @name
end

Instance Method Details

#parse_content(w, p, r) ⇒ Object



186
187
188
189
190
191
# File 'lib/wikiavro/xml.rb', line 186

def parse_content(w, p, r)
  p.send(@writer, r.read_string)
#      puts "inserter: exiting #{@name}"
  WikiAvro::XML.skip_tag(w, r, false)
#      puts "exited"
end