Class: Pdf::Builders::HeaderBuilder
- Inherits:
-
Object
- Object
- Pdf::Builders::HeaderBuilder
- Includes:
- DynamicComponents
- Defined in:
- lib/pdf/builders/header_builder.rb
Instance Attribute Summary collapse
-
#blueprint ⇒ Object
readonly
Returns the value of attribute blueprint.
Instance Method Summary collapse
- #context(source, **options) ⇒ Object
-
#initialize ⇒ HeaderBuilder
constructor
A new instance of HeaderBuilder.
- #logo(path, **options) ⇒ Object
- #qr_code(**options) ⇒ Object
- #text(value, **options) ⇒ Object
Methods included from DynamicComponents
#method_missing, #respond_to_missing?
Constructor Details
#initialize ⇒ HeaderBuilder
Returns a new instance of HeaderBuilder.
10 11 12 |
# File 'lib/pdf/builders/header_builder.rb', line 10 def initialize @blueprint = Blueprint.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pdf::DynamicComponents
Instance Attribute Details
#blueprint ⇒ Object (readonly)
Returns the value of attribute blueprint.
8 9 10 |
# File 'lib/pdf/builders/header_builder.rb', line 8 def blueprint @blueprint end |
Instance Method Details
#context(source, **options) ⇒ Object
22 23 24 |
# File 'lib/pdf/builders/header_builder.rb', line 22 def context(source, **) @blueprint.add(:context, source, **) end |
#logo(path, **options) ⇒ Object
14 15 16 |
# File 'lib/pdf/builders/header_builder.rb', line 14 def logo(path, **) @blueprint.add(:logo, path, **) end |
#qr_code(**options) ⇒ Object
18 19 20 |
# File 'lib/pdf/builders/header_builder.rb', line 18 def qr_code(**) @blueprint.add(:qr_code, **) end |
#text(value, **options) ⇒ Object
26 27 28 |
# File 'lib/pdf/builders/header_builder.rb', line 26 def text(value, **) @blueprint.add(:header_text, value, **) end |