lib/code/object/string.rb in code-ruby-0.5.2 vs lib/code/object/string.rb in code-ruby-0.5.3
- old
+ new
@@ -23,10 +23,13 @@
sig(arguments) { ::Code::Object::Number }
multiplication(value)
elsif operator == "reverse"
sig(arguments)
reverse
+ elsif operator == "include?"
+ sig(arguments) { ::Code::Object::String }
+ include?(value)
else
super
end
end
@@ -80,9 +83,13 @@
::Code::Object::String.new(raw * other.raw)
end
def reverse
::Code::Object::String.new(raw.reverse)
+ end
+
+ def include?(value)
+ ::Code::Object::Boolean.new(raw.include?(value.raw))
end
end
end
end