Class: ODDB::FiPDF::OrphanRule

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Rule

#initialize

Constructor Details

This class inherits a constructor from ODDB::FiPDF::Rule

Instance Attribute Details

- (Object) lines (readonly)

Returns the value of attribute lines



26
27
28
# File 'ext/fipdf/src/rules.rb', line 26

def lines
  @lines
end

- (Object) pagebreak (readonly)

Returns the value of attribute pagebreak



26
27
28
# File 'ext/fipdf/src/rules.rb', line 26

def pagebreak
  @pagebreak
end

Instance Method Details

- (Boolean) fulfilled?

Returns:

  • (Boolean)


27
28
29
# File 'ext/fipdf/src/rules.rb', line 27

def fulfilled?
  (@pagebreak == 0) || (@lines < 2) || (@pagebreak > 1)
end

- (Object) notify(event)



30
31
32
33
34
35
36
37
# File 'ext/fipdf/src/rules.rb', line 30

def notify(event)
  case event
  when :add_text_wrap
    @lines += 1
  when :ez_new_page
    @pagebreak = @lines unless @pagebreak > 0
  end
end