Class: Put::Debug::Incomparable

Inherits:
Struct
  • Object
show all
Defined in:
lib/put/debug.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#leftObject

Returns the value of attribute left

Returns:

  • (Object)

    the current value of left



4
5
6
# File 'lib/put/debug.rb', line 4

def left
  @left
end

#left_indexObject

Returns the value of attribute left_index

Returns:

  • (Object)

    the current value of left_index



4
5
6
# File 'lib/put/debug.rb', line 4

def left_index
  @left_index
end

#left_valueObject

Returns the value of attribute left_value

Returns:

  • (Object)

    the current value of left_value



4
5
6
# File 'lib/put/debug.rb', line 4

def left_value
  @left_value
end

#rightObject

Returns the value of attribute right

Returns:

  • (Object)

    the current value of right



4
5
6
# File 'lib/put/debug.rb', line 4

def right
  @right
end

#right_indexObject

Returns the value of attribute right_index

Returns:

  • (Object)

    the current value of right_index



4
5
6
# File 'lib/put/debug.rb', line 4

def right_index
  @right_index
end

#right_valueObject

Returns the value of attribute right_value

Returns:

  • (Object)

    the current value of right_value



4
5
6
# File 'lib/put/debug.rb', line 4

def right_value
  @right_value
end

#sorting_indexObject

Returns the value of attribute sorting_index

Returns:

  • (Object)

    the current value of sorting_index



4
5
6
# File 'lib/put/debug.rb', line 4

def sorting_index
  @sorting_index
end

Instance Method Details

#inspectObject



8
9
10
11
12
13
# File 'lib/put/debug.rb', line 8

def inspect
  both_puts_things = left.is_a?(PutsThing) && right.is_a?(PutsThing)
  left_desc = (both_puts_things ? left_value : left).inspect
  right_desc = (both_puts_things ? right_value : right).inspect
  "Sorting comparator at index #{sorting_index} failed, because items at indices #{left_index} and #{right_index} were not comparable. Their values were `#{left_desc}' and `#{right_desc}', respectively."
end