class Goby::C

Stores a pair of values as a couple.

Attributes

first[RW]
second[RW]

Public Class Methods

[](first, second) click to toggle source

Syntactic sugar to create a couple using C[a, b]

@param [Object] first the first object in the pair. @param [Object] second the second object in the pair.

# File lib/goby/util.rb, line 15
def self.[](first, second)
  C.new(first, second)
end
new(first, second) click to toggle source

@param [Object] first the first object in the pair. @param [Object] second the second object in the pair.

# File lib/goby/util.rb, line 21
def initialize(first, second)
  @first = first
  @second = second
end

Public Instance Methods

==(rhs) click to toggle source

@param [C] rhs the couple on the right.

# File lib/goby/util.rb, line 27
def ==(rhs)
  return ((@first == rhs.first) && (@second == rhs.second))
end