Class: Pair

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#firstObject

Returns the value of attribute first

Returns:

  • (Object)

    the current value of first



1
2
3
# File 'lib/static_ruby.rb', line 1

def first
  @first
end

#secondObject

Returns the value of attribute second

Returns:

  • (Object)

    the current value of second



1
2
3
# File 'lib/static_ruby.rb', line 1

def second
  @second
end

Instance Method Details

#to_aObject



2
3
4
# File 'lib/static_ruby.rb', line 2

def to_a
  [first, second]
end

#to_sObject



6
7
8
# File 'lib/static_ruby.rb', line 6

def to_s
  "Pair(#{first} #{second})"
end