Skip to content

Instantly share code, notes, and snippets.

@ecuageo
Created May 14, 2015 15:13
Show Gist options
  • Save ecuageo/0750fba992fb2c94ad3f to your computer and use it in GitHub Desktop.
Save ecuageo/0750fba992fb2c94ad3f to your computer and use it in GitHub Desktop.
use builtin conversion protocols 1
class GreekAlphabetArray
def initialize
@alpha = 'ἄ'
@beta = 'β'
@gamma = 'γ'
@delta = 'δ'
end
def to_a
[@alpha, @beta, @gamma, @delta]
end
end
fa = GreekAlphabetArray.new
first = fa.to_a[0]
second = fa.to_a[1]
puts "This is the first letter in the Greek Alphabet #{first}"
puts "And this the second #{second}"
_, _, third = fa.to_a
puts "And this the third #{third}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment