Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README.md for ex05 #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions courses/ruby/ex05_readme/README.md
Original file line number Diff line number Diff line change
@@ -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)