Created
April 9, 2013 19:43
-
-
Save PirosB3/5348736 to your computer and use it in GitHub Desktop.
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
def show_sentence(sentence) | |
file_name = "#{sentence}.txt" | |
# In this case, File.open statement returns the same contents returned from the block | |
File.open(file_name,"r") do |file| | |
# this inner block is returning the response from file.read() | |
file.read() | |
end | |
end | |
puts "Sentence is: " + show_sentence('lol') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment