Module: Pdf::DynamicComponents

Included in:
Builders::ContentBuilder, Builders::FooterBuilder, Builders::HeaderBuilder
Defined in:
lib/pdf/dynamic_components.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, **options, &block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/pdf/dynamic_components.rb', line 5

def method_missing(name, *args, **options, &block)
  if Pdf.component_registered?(name)
    @blueprint.add(name, *args, **options, &block)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/pdf/dynamic_components.rb', line 13

def respond_to_missing?(name, include_private = false)
  Pdf.component_registered?(name) || super
end