Class: InspectedBy::LineDecorator

Inherits:
Decorator
  • Object
show all
Defined in:
lib/inspected_by/core.rb

Instance Method Summary collapse

Methods inherited from Decorator

decorate, decorates, #initialize, method_missing, #method_missing

Constructor Details

This class inherits a constructor from InspectedBy::Decorator

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class InspectedBy::Decorator

Instance Method Details

#to_sObject



56
57
58
# File 'lib/inspected_by/core.rb', line 56

def to_s
  line.force_encoding('UTF-8')
end

#typeObject



45
46
47
48
49
50
51
52
53
54
# File 'lib/inspected_by/core.rb', line 45

def type
  case line
  when /^@@.*@@$/
    'context'
  when /^\+/
    'add'
  when /^-/
    'remove'
  end
end