回答:
...そしてオプションのパラメータが必要な場合
 class Bar
   define_method(:foo) do |arg=nil|                  
     arg                                                                                          
   end   
 end
 a = Bar.new
 a.foo
 #=> nil
 a.foo 1
 # => 1...必要なだけの引数
 class Bar
   define_method(:foo) do |*arg|                  
     arg                                                                                          
   end   
 end
 a = Bar.new
 a.foo
 #=> []
 a.foo 1
 # => [1]
 a.foo 1, 2 , 'AAA'
 # => [1, 2, 'AAA']...の組み合わせ
 class Bar
   define_method(:foo) do |bubla,*arg|
     p bubla                  
     p arg                                                                                          
   end   
 end
 a = Bar.new
 a.foo
 #=> wrong number of arguments (0 for 1)
 a.foo 1
 # 1
 # []
 a.foo 1, 2 ,3 ,4
 # 1
 # [2,3,4]...それらすべて
 class Bar
   define_method(:foo) do |variable1, variable2,*arg, &block|  
     p  variable1     
     p  variable2
     p  arg
     p  block.inspect                                                                              
   end   
 end
 a = Bar.new      
 a.foo :one, 'two', :three, 4, 5 do
   'six'
 end更新
Ruby 2.0は、二重引用符**(2つの星)を導入しました(引用します)。
Ruby 2.0ではキーワード引数が導入されており、**は*と同じように機能しますが、キーワード引数に対してです。キーと値のペアを含むハッシュを返します。
...もちろん、defineメソッドでも使用できます:)
 class Bar 
   define_method(:foo) do |variable1, variable2,*arg,**options, &block|
     p  variable1
     p  variable2
     p  arg
     p  options
     p  block.inspect
   end 
 end 
 a = Bar.new
 a.foo :one, 'two', :three, 4, 5, ruby: 'is awesome', foo: :bar do
   'six'
 end
# :one
# "two"
# [:three, 4, 5]
# {:ruby=>"is awesome", :foo=>:bar}名前付き属性の例:
 class Bar
   define_method(:foo) do |variable1, color: 'blue', **other_options, &block|
     p  variable1
     p  color
     p  other_options
     p  block.inspect
   end
 end
 a = Bar.new
 a.foo :one, color: 'red', ruby: 'is awesome', foo: :bar do
   'six'
 end
# :one
# "red"
# {:ruby=>"is awesome", :foo=>:bar}キーワード引数、splatおよびdouble splatを1つにまとめた例を作成しようとしていました。
 define_method(:foo) do |variable1, variable2,*arg, i_will_not: 'work', **options, &block|
    # ...または
 define_method(:foo) do |variable1, variable2, i_will_not: 'work', *arg, **options, &block|
    # ......しかし、これは機能しません。制限があるようです。考えてみると、splat演算子は「残りのすべての引数を取り込む」ことであり、double splatは「残りのすべてのキーワード引数を取り込む」ことであるため、それらを混在させると予想されるロジックが壊れてしまいます。(この点を証明するための参照はありません!)
2018年8月の更新:
概要記事:https : //blog.eq8.eu/til/metaprogramming-ruby-examples.html
a.foo 1代わりにすべきですfoo 1)。ありがとう!
                    Kevin Connerの回答に加えて、ブロック引数はメソッド引数と同じセマンティクスをサポートしていません。デフォルト引数またはブロック引数を定義することはできません。
これは、完全なメソッド引数のセマンティクスをサポートする新しい代替「stabby lambda」構文を備えたRuby 1.9でのみ修正されています。
例:
# Works
def meth(default = :foo, *splat, &block) puts 'Bar'; end
# Doesn't work
define_method :meth { |default = :foo, *splat, &block| puts 'Bar' }
# This works in Ruby 1.9 (modulo typos, I don't actually have it installed)
define_method :meth, ->(default = :foo, *splat, &block) { puts 'Bar' }2.2では、キーワード引数を使用できるようになりました:https : //robots.thoughtbot.com/ruby-2-keyword-arguments
define_method(:method) do |refresh: false|
  ..........
end