-
-
Save znz/bbd7a2373ee0ed4cad37cdd4bcde4297 to your computer and use it in GitHub Desktop.
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
Hello = "Hello" | |
# Hint: Stop the recursion. | |
def Hello | |
Hello%() + | |
" world" | |
end | |
puts Hello() |
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
s = "Dz" | |
# Hint: https://techlife.cookpad.com/entry/2018/12/25/110240 | |
s == s.upcase or | |
s == s.downcase or puts "Hello world" |
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
def say | |
s %= 'Small' | |
t = 'world' | |
puts "#{s} #{t}" | |
end | |
TracePoint.new(:line){|tp| | |
tp.binding.local_variable_set(:s, 'Hello') | |
tp.binding.local_variable_set(:t, 'Ruby') | |
tp.disable | |
}.enable(target: method(:say)) | |
say |
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
def say\ | |
s = 'Small' | |
t = 'world' | |
puts "#{s} #{t}" | |
end | |
TracePoint.new(:line){|tp| | |
tp.binding.local_variable_set(:s, 'Hello') | |
tp.binding.local_variable_set(:t, 'Ruby') | |
tp.disable | |
}.enable(target: method(:say)) | |
say |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment