Class: Stepmod::Utils::EquationLogger
- Inherits:
- 
      Object
      
        - Object
- Stepmod::Utils::EquationLogger
 
- Defined in:
- lib/stepmod/utils/equation_logger.rb
Instance Attribute Summary collapse
- 
  
    
      #anchor  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute anchor. 
- 
  
    
      #document  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute document. 
- 
  
    
      #equation  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute equation. 
- 
  
    
      #equation_converted  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute equation_converted. 
- 
  
    
      #equation_converted_with_bold_and_italics  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute equation_converted_with_bold_and_italics. 
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ EquationLogger 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of EquationLogger. 
- #log ⇒ Object
Constructor Details
#initialize ⇒ EquationLogger
Returns a new instance of EquationLogger.
| 13 14 15 | # File 'lib/stepmod/utils/equation_logger.rb', line 13 def initialize @logger = Logger.new(logger_file_path) end | 
Instance Attribute Details
#anchor ⇒ Object
Returns the value of attribute anchor.
| 7 8 9 | # File 'lib/stepmod/utils/equation_logger.rb', line 7 def anchor @anchor end | 
#document ⇒ Object
Returns the value of attribute document.
| 7 8 9 | # File 'lib/stepmod/utils/equation_logger.rb', line 7 def document @document end | 
#equation ⇒ Object
Returns the value of attribute equation.
| 7 8 9 | # File 'lib/stepmod/utils/equation_logger.rb', line 7 def equation @equation end | 
#equation_converted ⇒ Object
Returns the value of attribute equation_converted.
| 7 8 9 | # File 'lib/stepmod/utils/equation_logger.rb', line 7 def equation_converted @equation_converted end | 
#equation_converted_with_bold_and_italics ⇒ Object
Returns the value of attribute equation_converted_with_bold_and_italics.
| 7 8 9 | # File 'lib/stepmod/utils/equation_logger.rb', line 7 def equation_converted_with_bold_and_italics @equation_converted_with_bold_and_italics end | 
Instance Method Details
#log ⇒ Object
| 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # File 'lib/stepmod/utils/equation_logger.rb', line 17 def log Stepmod::Utils.increment_eqn_counter @logger.info do <<~MESSAGE =================== Equation #{Stepmod::Utils.eqn_counter} Start =================== Document: #{document} Nearest Anchor: #{anchor} Formula (original): #{equation} ------------------ Status: #{valid_asciimath?(equation_converted)} Formula (asciimath): #{equation_converted} ------------------ Status: #{valid_asciimath?(equation_converted_with_bold_and_italics)} Formula (asciimath with bold and italics included): #{equation_converted_with_bold_and_italics} =================== Equation #{Stepmod::Utils.eqn_counter} End =================== MESSAGE end end |