Sha256: 89e35eaa26e88f9266920de29c1518fdb5659b329f115c0bd76c097dd41d3b02

Contents?: true

Size: 592 Bytes

Versions: 10

Compression:

Stored size: 592 Bytes

Contents

require File.dirname(__FILE__) + '/../lib/highrise'

def turn_methods_public(klass, method_name = nil)
  if method_name
    klass.class_eval do
      public method_name
    end
  else
    turn_all_methods_public klass
  end
end

def turn_all_methods_public(klass)
  klass.class_eval do
    private_instance_methods.each { |instance_method| public instance_method }
    private_methods.each { |method| public_class_method method } 
    protected_instance_methods.each { |instance_method| public instance_method }
    protected_methods.each { |method| public_class_method method } 
  end  
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
kmayer-highrise-1.0.1 spec/spec_helper.rb
rogerio-augusto-highrise-2.0.4 spec/spec_helper.rb
rogerio-augusto-highrise-2.0.3 spec/spec_helper.rb
rogerio-augusto-highrise-2.0.2 spec/spec_helper.rb
highrise-2.0.1 spec/spec_helper.rb
highrise-2.0.0 spec/spec_helper.rb
highrise-1.2.0 spec/spec_helper.rb
highrise-1.0.4 spec/spec_helper.rb
highrise-1.0.3 spec/spec_helper.rb
highrise-1.0.2 spec/spec_helper.rb