Class DiffTools::Chunk
In: lib/diff_tools.rb
Parent: Object

Methods

inspect   new   to_s  

Attributes

contents  [R] 
path  [R] 

Public Class methods

[Source]

# File lib/diff_tools.rb, line 74
    def initialize ( anObject )
      case anObject
      when String
        @path = anObject[/\AIndex: (.+)$/, 1]
        raise ArgumentError, "The path cannot be empty (#{anObject})" if @path.nil? or @path.empty?
        @contents = anObject
      else
        raise TypeError, "Unexpected type #{anObject.class}"
      end
    end

Public Instance methods

[Source]

# File lib/diff_tools.rb, line 89
    def inspect
      "#<#{self.class}: Index: #@path>"
    end

[Source]

# File lib/diff_tools.rb, line 85
    def to_s
      @contents
    end

[Validate]