Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paulopatto/f151f1e4e6d687c9f662a6c1e324194f to your computer and use it in GitHub Desktop.
Save paulopatto/f151f1e4e6d687c9f662a6c1e324194f to your computer and use it in GitHub Desktop.
# http://bit.ly/2xf8pEv
def meditate(cushion, meditation = 'kinhin', *room_itens, time: , posture: 'kekkafuza', **periods, &block)
puts "====================================="
puts "We are praticing #{meditation}, for #{time} minutes, in the #{posture} posture (ouch, my knees!)."
puts "Room item: #{room_itens}"
puts "Periods: #{periods}"
puts "====================================="
block.call
end
meditate('zafu', # cushion
'zazen', # meditation
'zabuston', # room_item
'incense', # room_item
time: 40, # keyword argument
# Omitted the posture optional keyword argument;
period1: 'morning', # Passed a couple of extra keyword arguments (period1: "morning", period2: "afternoon") through the **periods parameter;
period2: 'afternom') { puts "\n\tHello from inside the block" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment