On Mon, Sep 06, 2010 at 06:12:39AM +0900, Tim Romberg wrote:
> module Menus
> 
>   class Main_Menu
>     # This is a class method because of the "self"
>     def self.main_menu
>       puts "---------------------------"

Is the issue that you want to be able to create multiple menus from the same
code? Then make it data-driven.

Your current code never creates any instances of Main_Menu, but instead
defines methods on the class itself (e.g. def self.main_menu). If you define
instance methods, then each instance can have its own data structure. e.g.

class Menu
  # Pass in array of options
  def initialize(options)
    @options = options
  end

  def main_menu
    puts "---------------------------"
    puts "      Menu"
    @options.each_with_index do |item, i|
      puts "  #{i+1}. #{item}"
    end
    puts
    puts "What do you want to do?"
    #... etc
  end
end

m = Menu.new ["Checkin","Checkout","Lists","Economy","Exit"]
m.main_menu

Continue to make the rest of your code data-driven. e.g. Instead of

>        while input > 5 || input < 1 do

you can write

>        while input > @options.size || input < 1 do

I suggest that make_choice should move out of this class, and be the
responsibility of the caller to do something based on the returned value.
(If you really wanted to integrate this you could pass in an array of
lambdas for code to be executed on each choice, but I don't really see the
need for this added complexity)

> class Main_Menu
>   include Menus

I've no idea why you're including Menus into the class - especially as at
the moment you're not creating any instances of the class. I'd drop that.

Regards,

Brian.