Class: Indoctrinatr::Tools::ContentForTexFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/indoctrinatr/tools/content_for_tex_files.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ ContentForTexFiles

a class that DefaultValues, TemplateDocumentationContent, and field_names_as_variables should inherit from or to be precise: When we want use variables in an indoctrinatr tex.erb file, we should use this class



8
9
10
11
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 8

def initialize configuration
  @_configuration = configuration
  _build_from_configuration
end

Instance Method Details

#_build_from_configurationObject



29
30
31
32
33
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 29

def _build_from_configuration
  @_template_asset_path = @_configuration.template_asset_path
  @_output_file_name = @_configuration.output_file_name # does this fit here?
  @_default_file_name = @_configuration.default_file_name # does this fit here?
end

#customized_output_file_nameObject



21
22
23
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 21

def customized_output_file_name
  @_customized_output_file_name ||= eval('"' + @_output_file_name + '"') # rubocop:disable Lint/Eval
end

#retrieve_bindingObject



17
18
19
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 17

def retrieve_binding
  binding
end

#template_asset_pathObject



25
26
27
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 25

def template_asset_path
  @_template_asset_path
end

#textile2latex(textile) ⇒ Object



13
14
15
# File 'lib/indoctrinatr/tools/content_for_tex_files.rb', line 13

def textile2latex textile
  RedCloth.new(textile).to_latex
end