Class: ODDB::FiPDF::FachinfoRule

Inherits:
Rule show all
Defined in:
ext/fipdf/src/rules.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (FachinfoRule) initialize(*args)

A new instance of FachinfoRule



55
56
57
58
59
# File 'ext/fipdf/src/rules.rb', line 55

def initialize(*args)
  super
  @paragraphs = 0
  @pagebreak = -1
end

Instance Attribute Details

- (Object) pagebreak (readonly)

Returns the value of attribute pagebreak



54
55
56
# File 'ext/fipdf/src/rules.rb', line 54

def pagebreak
  @pagebreak
end

- (Object) paragraphs (readonly)

Returns the value of attribute paragraphs



54
55
56
# File 'ext/fipdf/src/rules.rb', line 54

def paragraphs
  @paragraphs
end

Instance Method Details

- (Boolean) fulfilled?

Returns:

  • (Boolean)


60
61
62
# File 'ext/fipdf/src/rules.rb', line 60

def fulfilled?
  @pagebreak != 0
end

- (Object) notify(event)



63
64
65
66
67
68
69
70
# File 'ext/fipdf/src/rules.rb', line 63

def notify(event)
  case event
  when :write_paragraph
    @paragraphs += 1
  when :ez_new_page
    @pagebreak = @paragraphs if @pagebreak < 0
  end
end