mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Handle version 2.1
This commit is contained in:
@@ -3,10 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/neo')
|
|||||||
class AboutIteration < Neo::Koan
|
class AboutIteration < Neo::Koan
|
||||||
|
|
||||||
# -- An Aside ------------------------------------------------------
|
# -- An Aside ------------------------------------------------------
|
||||||
# Ruby 1.8 stores names as strings. Ruby 1.9 stores names as
|
# Ruby 1.8 stores names as strings. Ruby 1.9 and later stores names
|
||||||
# symbols. So we use a version dependent method "as_name" to convert
|
# as symbols. So we use a version dependent method "as_name" to
|
||||||
# to the right format in the koans. We will use "as_name" whenever
|
# convert to the right format in the koans. We will use "as_name"
|
||||||
# comparing to lists of methods.
|
# whenever comparing to lists of methods.
|
||||||
|
|
||||||
in_ruby_version("1.8") do
|
in_ruby_version("1.8") do
|
||||||
def as_name(name)
|
def as_name(name)
|
||||||
@@ -14,7 +14,7 @@ class AboutIteration < Neo::Koan
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
in_ruby_version("1.9", "2.0") do
|
in_ruby_version("1.9", "2") do
|
||||||
def as_name(name)
|
def as_name(name)
|
||||||
name.to_sym
|
name.to_sym
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user