/amenable_rb

Flexibility when you need it.

Primary LanguageRubyMIT LicenseMIT

Amenable

Removes exessive parameters from function calls.

require 'amenable'

class Dog
  using Amenable

  amenable def bark(n = 1)
    ([ :woof ] * n).join(" ")
  end
end


Dog.new.bark
> "woof"

Dog.new.bark(2)
> "woof woof"

Dog.new.bark(2, 3, 4, foo: 5)
> "woof woof"

Contributing

Yes please :)

  1. Fork it
  2. Create your feature branch (git checkout -b my-feature)
  3. Ensure the tests pass (bundle exec rspec)
  4. Commit your changes (git commit -am 'awesome new feature')
  5. Push your branch (git push origin my-feature)
  6. Create a Pull Request

Gem codecov