Method: ChiliPDF::StringToken#initialize

Defined in:
lib/chili_pdf/string_token.rb

#initialize(matcher, replacement_object, description = nil) ⇒ StringToken

Public: Create new instance of StringToken class

matcher - the #to_s value to search for replacement_object - the value to replace ‘matcher’ with description - a friendly description which can be used

to explain what purpose the matcher is
intended to serve

‘replacement_object’ may be any object, but special behavior exists if the value is a Proc object. Refer to the #apply_to documentation for details on said behavior.

Returns new instance of StringToken



39
40
41
42
43
# File 'lib/chili_pdf/string_token.rb', line 39

def initialize(matcher, replacement_object, description = nil)
  @matcher = matcher
  @replacement_object = replacement_object
  @description = description.blank? ? DEFAULT_DESCRIPTION : description
end