class Pair

Attributes

first[R]
second[R]
size[R]

Public Class Methods

new(first, second) click to toggle source
# File lib/static_ruby.rb, line 4
def initialize(first, second)
  @first = first
  @second = second
  @size = 2
end

Public Instance Methods

!=(o) click to toggle source
# File lib/static_ruby.rb, line 22
def !=(o)
  @first != o.first || @second != o.second
end
==(o) click to toggle source
# File lib/static_ruby.rb, line 18
def ==(o)
  @first == o.first && @second == o.second
end
each(&block) click to toggle source
# File lib/static_ruby.rb, line 26
def each(&block)
  block.call(@first)
  block.call(@second)
end
to_a() click to toggle source
# File lib/static_ruby.rb, line 10
def to_a
  [@first, @second]
end
to_s() click to toggle source
# File lib/static_ruby.rb, line 14
def to_s
  "Pair(#{@first} #{@second})"
end