box-o-sand/RubyFun/wikibooks-tutorial/grocery-list.rb

39 lines
515 B
Ruby
Raw Normal View History

2011-01-03 18:57:29 +00:00
puts <<GROCERY_LIST
Grocery list
------------
1. Salad mix.
2. Strawberries.*
3. Cereal.
4. Milk.*
* Organic
GROCERY_LIST
2011-01-03 19:01:42 +00:00
puts '
Categorized Grocery list
------------------------
'
2011-01-03 18:57:29 +00:00
puts 'Produce', '-------', <<PRODUCE, 'Dairy', '-----', <<DAIRY, '* Organic'
1. Strawberries*
2. Blueberries
PRODUCE
1. Yogurt
2. Milk*
3. Cottage Cheese
2011-01-03 19:01:42 +00:00
2011-01-03 18:57:29 +00:00
DAIRY
2011-01-03 19:01:42 +00:00
puts
puts 'Indented Grocery list',
'---------------------', <<-GROCERY_LIST
1. Salad mix.
2. Strawberries.
3. Cereal.
4. Milk.
GROCERY_LIST