Class: ODDB::FiPDF::WidowRule

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



40
41
42
# File 'ext/fipdf/src/rules.rb', line 40

def lines
  @lines
end

- (Object) pagebreak (readonly)

Returns the value of attribute pagebreak



40
41
42
# File 'ext/fipdf/src/rules.rb', line 40

def pagebreak
  @pagebreak
end

Instance Method Details

- (Boolean) fulfilled?

Returns:

  • (Boolean)


41
42
43
# File 'ext/fipdf/src/rules.rb', line 41

def fulfilled?
  !((@lines - @pagebreak) == 1 && @pagebreak != 0)
end

- (Object) notify(event)



44
45
46
47
48
49
50
51
# File 'ext/fipdf/src/rules.rb', line 44

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