From d9a2fbe407f4300b9f11a16b4d2a3cd8a0eb0124 Mon Sep 17 00:00:00 2001 From: Anna Kulakova Date: Tue, 3 Sep 2019 18:14:37 +0300 Subject: [PATCH] Add README.md for ex05 --- courses/ruby/ex05_readme/README.md | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 courses/ruby/ex05_readme/README.md diff --git a/courses/ruby/ex05_readme/README.md b/courses/ruby/ex05_readme/README.md new file mode 100644 index 00000000..21fddd86 --- /dev/null +++ b/courses/ruby/ex05_readme/README.md @@ -0,0 +1,33 @@ +# string-method_missing + +In this exercise you should implement next methods: + +- var.ask +- var.names_compare? +- var.parent + +where 'var' is your variable name and 'names_compare' is expected string from tests. + +## .ask + +This spec should return instance of StringAsk class + +Example: var = 'some_string'.ask # => 'some_string' + +## .names_compare? + +This spec should compare the string with self value of instance of StringAsk class. + +Example: var.some_string? # => true + var.other_string? # => false +Thus, you need to implement method for string which will return true if string is the same as the method name. + +## .parent + +This spec should return the parent class your class was inheritated from. + +Example: var.parent # => String + +## Resources + +[Method Missing in Ruby](https://medium.com/podiihq/method-missing-in-ruby-af4c6edd5130)