Add to_hayes method to some basic classes

develop
Guillaume DOTT 2013-09-03 17:01:22 +02:00
parent 404f7d8290
commit b1568bbf24
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
class Object
def to_hayes; "\"#{self.to_s}\""; end
end
class Fixnum
def to_hayes; self.to_s; end
end
class TrueClass
def to_hayes; '1'; end
end
class FalseClass
def to_hayes; '0'; end
end
class Array
def to_hayes; self.map(&:to_hayes).join(','); end
end