Class: Prawn::SwissQRBill::Sections::Section
- Inherits:
-
Object
- Object
- Prawn::SwissQRBill::Sections::Section
- Defined in:
- lib/prawn/swiss_qr_bill/sections/section.rb
Overview
Section main class which can draw itself at the right position.
Subclasses shall implement the draw method with the box block:
def draw
box do
doc.text 'example'
draw_something
end
end
Direct Known Subclasses
PaymentAmount, PaymentFurtherInformation, PaymentInformation, PaymentTitle, QRCode, ReceiptAcceptance, ReceiptAmount, ReceiptInformation, ReceiptTitle
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#specs ⇒ Object
specifications for subclass’ section, @see Specification for details.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(document, data, options = {}) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(document, data, options = {}) ⇒ Section
Returns a new instance of Section.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/prawn/swiss_qr_bill/sections/section.rb', line 22 def initialize(document, data, = {}) unless self.class.const_defined?(:KEY) raise NotImplementedError, "constant KEY not defined in class #{self.class}" end @doc = document @data = data @options = || {} load_specs end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
17 18 19 |
# File 'lib/prawn/swiss_qr_bill/sections/section.rb', line 17 def doc @doc end |
#specs ⇒ Object
specifications for subclass’ section, @see Specification for details
20 21 22 |
# File 'lib/prawn/swiss_qr_bill/sections/section.rb', line 20 def specs @specs end |
Instance Method Details
#draw ⇒ Object
34 35 36 |
# File 'lib/prawn/swiss_qr_bill/sections/section.rb', line 34 def draw raise NotImplementedError, 'Subcluss must implement draw method.' end |