Class: Tailor::Problem
- Inherits:
- 
      Hash
      
        - Object
- Hash
- Tailor::Problem
 
- Includes:
- LogSwitch::Mixin
- Defined in:
- lib/tailor/problem.rb
Overview
A Hashed data structure that simply defines the data needed to report a problem
Instance Method Summary collapse
- 
  
    
      #initialize(type, line, column, message, level)  ⇒ Problem 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Problem. 
- 
  
    
      #set_values  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Sets the standard values for the problem based on the type and binding. 
Constructor Details
#initialize(type, line, column, message, level) ⇒ Problem
Returns a new instance of Problem.
| 13 14 15 16 17 18 19 20 21 22 23 24 | # File 'lib/tailor/problem.rb', line 13 def initialize(type, line, column, , level) @type = type @line = line @column = column @message = @level = level set_values subclass_name = self.class.to_s.sub(/^Tailor::/, '') msg = "<#{subclass_name}> #{self[:line]}[#{self[:column]}]: " msg << "#{@level.upcase}[:#{self[:type]}] #{self[:message]}" log msg end | 
Instance Method Details
#set_values ⇒ Object
Sets the standard values for the problem based on the type and binding.
| 27 28 29 30 31 32 33 | # File 'lib/tailor/problem.rb', line 27 def set_values self[:type] = @type self[:line] = @line self[:column] = @column self[:message] = @message self[:level] = @level end |