Class: WikiAvro::MediaWiki::Namespace

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

Instance Attribute Summary

Attributes inherited from XML::Element

#attr

Instance Method Summary collapse

Methods inherited from XML::Leaf

#initialize

Methods inherited from XML::Element

#optional?, #parse

Constructor Details

This class inherits a constructor from WikiAvro::XML::Leaf

Instance Method Details

#nameObject



214
215
216
# File 'lib/wikiavro/mediawiki.rb', line 214

def name
  'namespace'
end

#parse_attributes(w, p, r) ⇒ Object



222
223
224
225
# File 'lib/wikiavro/mediawiki.rb', line 222

def parse_attributes(w, p, r)
  @key = r['key']
  @case = r['case']
end

#parse_content(w, p, r) ⇒ Object



227
228
229
230
231
# File 'lib/wikiavro/mediawiki.rb', line 227

def parse_content(w, p, r)
  name = r.read_string
  WikiAvro::XML.skip_tag(w, r, false)
  w.namespace(@key, @case, name)
end

#resetObject



218
219
220
# File 'lib/wikiavro/mediawiki.rb', line 218

def reset
  # everything is overwritten each cycle anyway
end