Class: WikiAvro::MediaWiki::Contributor

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

Instance Attribute Summary collapse

Attributes inherited from XML::Element

#attr

Instance Method Summary collapse

Methods inherited from XML::Element

#optional?, #parse

Constructor Details

#initializeContributor

Returns a new instance of Contributor.



394
395
396
# File 'lib/wikiavro/mediawiki.rb', line 394

def initialize
  super([ContributorGroup.new])
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



374
375
376
# File 'lib/wikiavro/mediawiki.rb', line 374

def id
  @id
end

#ipObject

Returns the value of attribute ip.



376
377
378
# File 'lib/wikiavro/mediawiki.rb', line 376

def ip
  @ip
end

#usernameObject

Returns the value of attribute username.



375
376
377
# File 'lib/wikiavro/mediawiki.rb', line 375

def username
  @username
end

Instance Method Details

#handle_content(w, p, r) ⇒ Object



389
390
391
392
# File 'lib/wikiavro/mediawiki.rb', line 389

def handle_content(w, p, r)
  p.contributor = {:deleted => @deleted, :id => id,
                   :username => username, :ip => ip}
end

#nameObject



370
371
372
# File 'lib/wikiavro/mediawiki.rb', line 370

def name
  'contributor'
end

#parse_attributes(w, p, r) ⇒ Object



385
386
387
# File 'lib/wikiavro/mediawiki.rb', line 385

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

#resetObject



378
379
380
381
382
383
# File 'lib/wikiavro/mediawiki.rb', line 378

def reset
  @id = nil
  @username = nil
  @ip = nil
  @deleted = nil
end