EasyClassToInstanceMethod
As long as there is an instance method on your class, then this will create a class method for it for easy calling. Makes this:
Something.new(1, 2).execute
Into:
Something.execute(1, 2)
Installation
Add this line to your application's Gemfile:
gem 'easy_class_to_instance_method'
And then execute:
$ bundle
Or install it yourself as:
$ gem install easy_class_to_instance_method
In a class:
class MyClass
easy_class_to_instance
def initialize(a, b)
@a = a
@b = b
end
def my_action
puts "#{@a}, #{@b}"
end
end
Call it:
MyClass.my_action('Hello', 'there')
Usage
TODO: Write usage instructions here
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request