Let's try to create too long method chain!
install it yourself as:
$ gem install shiritori
Let's start creation long method chain.
-
You set first object.
-
Input the method that object can use.
- You can not use the method that has been used once.
- Don't override or define new method.
-
It continue until the method can not be input.
-
Let's enjoy shiritori!
- block syntax can use only '{}', not use 'do - end' syntax.
- if you want to pass arguments, please enclosed '()'.
bad
Please input next method > +5
Exec command 3.+5
good
Please input next method > +(5)
Exec command 3.+(5)
% shiritori start
+--------------------------------------------------+
| |
| Welcome to the Shiritori! |
| |
+--------------------------------------------------+
Please input first object > "Hello"
+----------------------+
| Current method chain |
+----------------------+
| "Hello" |
+----------------------+
+---------------+-------------+----------------+
| Current Class | Chain Count | Current Object |
+---------------+-------------+----------------+
| String | 0 | "Hello" |
+---------------+-------------+----------------+
Please input next method > chars
Exec command "Hello".chars
+----------------------+
| Current method chain |
+----------------------+
| "Hello".chars |
+----------------------+
+---------------+-------------+---------------------------+
| Current Class | Chain Count | Current Object |
+---------------+-------------+---------------------------+
| Array | 1 | ["H", "e", "l", "l", "o"] |
+---------------+-------------+---------------------------+
Success!
Please input next method > first
Exec command ["H", "e", "l", "l", "o"].first
+----------------------+
| Current method chain |
+----------------------+
| "Hello".chars.first |
+----------------------+
+---------------+-------------+----------------+
| Current Class | Chain Count | Current Object |
+---------------+-------------+----------------+
| String | 2 | "H" |
+---------------+-------------+----------------+
Success!
Please input next method >
- Fork it ( https://github.com/siman-man/shiritori/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request