Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

concluido o AboutProxyObjectProject

  • Loading branch information...
commit f1936c595b682f93152bfec46335bc0ef1a0486c 1 parent 49d16b5
Amalrik Maia authored
Showing with 22 additions and 2 deletions.
  1. +1 −1  .path_progress
  2. +21 −1 about_proxy_object_project.rb
2  .path_progress
View
@@ -1 +1 @@
-0,0,1,2,3,4,5,6,6,6,6,7,7,7,7,7,8,8,9,10,11,12,13,13,13,14,14,14,14,15,15,15,16,17,17,18,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,21,21,23,23,24,24,25,27,27,27,28,28,29,30,32,32,25,32,32,32,34,36,37,38,40,40,45,46,47,53,54,55,56,58,59,61,61,62,62,67,67,67,70,71,71,71,71,71,72,72,76,78,79,80,80,80,81,83,83,85,86,86,87,88,88,90,91,91,92,94,94,95,95,95,97,99,101,101,103,103,104,105,107,107,110,110,110,110,110,110,110,110,110,110,110,111,112,112,114,118,118,118,118,118,118,118,118,118,118,119,120,121,121,123,127,128,128,128,131,136,136,138,140,140,140,142,144,144,145,144,147,147,147,147,147,147,148,148,148,150,151,152,152,152,152,152,144,154,154,159,160,160,160,160,160,160,161,161,161,162,162,164,169,171,172,174,175,176,177,177,184,184,185,185,186,186,186,189,193,195,197,197,199,199,200,200,203,204,204,206,208,211,215,218,220,222,223,226,227,227,228,228,229,235,238,238,238,244,247,247,247,250,251,253,253,253,253,255,257,259
+0,0,1,2,3,4,5,6,6,6,6,7,7,7,7,7,8,8,9,10,11,12,13,13,13,14,14,14,14,15,15,15,16,17,17,18,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,21,21,23,23,24,24,25,27,27,27,28,28,29,30,32,32,25,32,32,32,34,36,37,38,40,40,45,46,47,53,54,55,56,58,59,61,61,62,62,67,67,67,70,71,71,71,71,71,72,72,76,78,79,80,80,80,81,83,83,85,86,86,87,88,88,90,91,91,92,94,94,95,95,95,97,99,101,101,103,103,104,105,107,107,110,110,110,110,110,110,110,110,110,110,110,111,112,112,114,118,118,118,118,118,118,118,118,118,118,119,120,121,121,123,127,128,128,128,131,136,136,138,140,140,140,142,144,144,145,144,147,147,147,147,147,147,148,148,148,150,151,152,152,152,152,152,144,154,154,159,160,160,160,160,160,160,161,161,161,162,162,164,169,171,172,174,175,176,177,177,184,184,185,185,186,186,186,189,193,195,197,197,199,199,200,200,203,204,204,206,208,211,215,218,220,222,223,226,227,227,228,228,229,235,238,238,238,244,247,247,247,250,251,253,253,253,253,255,257,259,259,259,259,259,259,259,259,259,259,260,260,258,260,260,260,262,262,263,269
22 about_proxy_object_project.rb
View
@@ -15,9 +15,29 @@
class Proxy
def initialize(target_object)
@object = target_object
- # ADD MORE CODE HERE
+ @mensagens = []
end
+ def method_missing(method_name, *args, &block)
+ @mensagens << method_name
+ @object.send(method_name, *args, &block)
+ end
+
+ def messages
+ @mensagens
+ end
+
+ def called?(method_name)
+ if @mensagens.find_index(method_name) != nil
+ true
+ else
+ false
+ end
+ end
+
+ def number_of_times_called(method_name)
+ @mensagens.grep(method_name).count
+ end
# WRITE CODE HERE
end
Please sign in to comment.
Something went wrong with that request. Please try again.