Skip to content
Browse files

added Symbol#to_sym

  • Loading branch information...
1 parent 983ba0a commit ac09861bb2962f22c7358b6f153f6a29ed7a01bd @bakkdoor committed Dec 1, 2011
Showing with 9 additions and 0 deletions.
  1. +4 −0 lib/symbol.fy
  2. +5 −0 tests/symbol.fy
View
4 lib/symbol.fy
@@ -44,4 +44,8 @@ class Symbol {
def arity {
1
}
+
+ def to_sym {
+ self
+ }
}
View
5 tests/symbol.fy
@@ -27,4 +27,9 @@ FancySpec describe: Symbol with: {
x = true
if: x then: 'foo else: 'bar . is: "foo"
}
+
+ it: "returns self" with: 'to_sym when: {
+ 'foo to_sym is: 'foo
+ 'bar to_sym is: 'bar
+ }
}

0 comments on commit ac09861

Please sign in to comment.
Something went wrong with that request. Please try again.