Class: ODDB::FiPDF::WidowRule

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

Instance Attribute Summary collapse

Attributes inherited from Rule

#name

Instance Method Summary collapse

Methods inherited from Rule

#initialize

Constructor Details

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

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



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

def lines
  @lines
end

#pagebreakObject (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

#fulfilled?Boolean

Returns:

  • (Boolean)


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

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

#notify(event) ⇒ Object



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