eltiare (owner)

Revisions

gist: 30192 Download_button fork
public
Public Clone URL: git://gist.github.com/30192.git
Ruby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#This works:
 
    drop_class.class_eval do
      allowed_methods.each do |am|
        define_method am do
          @object.send(am)
        end
      end
    end
 
#This doesn't:
 
  drop_class.class_eval {
    allowed_methods.each { |am|
      define_method am { @object.send(am) }
    }
  }