Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: gthank/ruby_koans
...
head fork: gthank/ruby_koans
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 04, 2012
Hank Gay Koans 262 and 263 pass. c2f4eb1
Hank Gay Koan 264 passes. 37e5e30
Hank Gay Whoopee! Up to Koan 270! 06db2c6
Showing with 15 additions and 2 deletions.
  1. +15 −2 koans/about_proxy_object_project.rb
17 koans/about_proxy_object_project.rb
View
@@ -13,12 +13,25 @@
# of the Proxy class is given in the AboutProxyObjectProject koan.
class Proxy
+ attr_reader :messages
+
def initialize(target_object)
@object = target_object
- # ADD MORE CODE HERE
+ @messages = []
+ end
+
+ def method_missing(method_name, *args, &block)
+ @messages << method_name
+ @object.send(method_name, *args, &block)
end
- # WRITE CODE HERE
+ def called?(method_name)
+ return @messages.include?(method_name)
+ end
+
+ def number_of_times_called(method_name)
+ return @messages.count(method_name)
+ end
end
# The proxy object should pass the following Koan:

No commit comments for this range

Something went wrong with that request. Please try again.