Class: ODDB::FiPDF::FachinfoRule

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

Instance Attribute Summary collapse

Attributes inherited from Rule

#name

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ FachinfoRule

Returns 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

#pagebreakObject (readonly)

Returns the value of attribute pagebreak.



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

def pagebreak
  @pagebreak
end

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

#fulfilled?Boolean

Returns:

  • (Boolean)


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

def fulfilled?
	@pagebreak != 0
end

#notify(event) ⇒ Object



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