Class: WikiAvro::MediaWiki::Revision

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

#initializeRevision

Returns a new instance of Revision.



475
476
477
478
# File 'lib/wikiavro/mediawiki.rb', line 475

def initialize
  super([Id.new, Timestamp.new, Contributor.new,
         RevisionFlags.new, Text.new])
end

Instance Attribute Details

#bytesObject

Returns the value of attribute bytes.



448
449
450
# File 'lib/wikiavro/mediawiki.rb', line 448

def bytes
  @bytes
end

#commentObject

Returns the value of attribute comment.



446
447
448
# File 'lib/wikiavro/mediawiki.rb', line 446

def comment
  @comment
end

#contributorObject

Returns the value of attribute contributor.



444
445
446
# File 'lib/wikiavro/mediawiki.rb', line 444

def contributor
  @contributor
end

#idObject

Returns the value of attribute id.



442
443
444
# File 'lib/wikiavro/mediawiki.rb', line 442

def id
  @id
end

#minorObject

Returns the value of attribute minor.



445
446
447
# File 'lib/wikiavro/mediawiki.rb', line 445

def minor
  @minor
end

#textObject

Returns the value of attribute text.



450
451
452
# File 'lib/wikiavro/mediawiki.rb', line 450

def text
  @text
end

#text_deletedObject

Returns the value of attribute text_deleted.



447
448
449
# File 'lib/wikiavro/mediawiki.rb', line 447

def text_deleted
  @text_deleted
end

#textidObject

Returns the value of attribute textid.



449
450
451
# File 'lib/wikiavro/mediawiki.rb', line 449

def textid
  @textid
end

#timestampObject

Returns the value of attribute timestamp.



443
444
445
# File 'lib/wikiavro/mediawiki.rb', line 443

def timestamp
  @timestamp
end

Instance Method Details

#handle_content(w, p, r) ⇒ Object



468
469
470
471
472
473
# File 'lib/wikiavro/mediawiki.rb', line 468

def handle_content(w, p, r)
  p.revision_count += 1
  n = p.revision_count
  w.revision(id, p.id, n, timestamp, contributor, minor,
             comment, text_deleted, bytes, textid, text)
end

#nameObject



452
453
454
# File 'lib/wikiavro/mediawiki.rb', line 452

def name
  'revision'
end

#resetObject



456
457
458
459
460
461
462
463
464
465
466
# File 'lib/wikiavro/mediawiki.rb', line 456

def reset
  @id = nil
  @timestamp = nil
  @contributor = nil
  @minor = nil
  @comment = nil
  @text_deleted = nil
  @bytes = nil
  @textid = nil
  @text = nil
end