Class: PdfTemplator::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf_templator/type.rb

Direct Known Subclasses

NumericType, TextType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, args = {}) ⇒ Type

Returns a new instance of Type.



8
9
10
11
# File 'lib/pdf_templator/type.rb', line 8

def initialize(content, args = {})
  @content = content
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/pdf_templator/type.rb', line 6

def args
  @args
end

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/pdf_templator/type.rb', line 5

def content
  @content
end

Instance Method Details

#call(_value) ⇒ Object

This method is called immediately when a type is found. Override it in sub-classes.



15
16
17
18
# File 'lib/pdf_templator/type.rb', line 15

def call(_value)
  fail NotImplementedError,
       "you must override the `call' method for option #{self.class}"
end