Last active
October 24, 2017 13:37
-
-
Save EDDYMENS/e4564071f84752ec3f2061887a71418f to your computer and use it in GitHub Desktop.
Experimenting with DSLs in Ruby . This time trying to get closer to English as possible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.new("edmond"). convert_to_upper_case. then. reverse_the_string. lastly. display_to_screen | |
class String | |
def initialize(string) | |
@@string = string | |
end | |
def convert_to_upper_case() | |
@@string = @@string.upcase() | |
self | |
end | |
def convert_to_lower_case() | |
@@string = @@string.downcase() | |
self | |
end | |
def reverse_the_string() | |
@@string = @@string.reverse() | |
self | |
end | |
def display_to_screen() | |
puts @@string | |
self | |
end | |
def then() | |
self | |
end | |
def lastly() | |
self | |
end | |
def also() | |
self | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment