Module: Commander::UI::AskForClass

Included in:
Object
Defined in:
lib/commander/user_interaction.rb

Overview

Implements ask_for_CLASS methods.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



98
99
100
101
102
103
# File 'lib/commander/user_interaction.rb', line 98

def method_missing meth, *args, &block
  case meth.to_s
  when /^ask_for_([\w]+)/ ; $terminal.ask(args.first, eval($1.capitalize))
  else super
  end
end