Last active
July 18, 2016 04:44
-
-
Save vcolavin/05e31cae2a49051646f11fccfa0d410c to your computer and use it in GitHub Desktop.
Ruby modules displaying inexplicit dependencies
This file contains 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
module MyFirstModule | |
def first_public_method(my_string) | |
second_public_method(my_string) | |
end | |
end | |
module MySecondModule | |
def second_public_method(my_string) | |
return "#{my_string} 1" | |
end | |
end | |
class MyClass | |
include MyFirstModule | |
include MySecondModule | |
end | |
puts MyClass.new.first_public_method("hey") # => "hey 1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment