mixin

mixin

A small macro that allows you to specify access level when delegating methods

Installation

Add this to your application's shard.yml:

dependencies:
  mixin:
    github: unn4m3d/mixin

Usage

require "mixin"

class Foo
  @foo = "ABC"

  delegate downcase, to: @foo, access: :protected
  delegate strip, to: @foo, access: :private

  def to_s
    downcase
  end
end

Contributing

  1. Fork it ( https://github.com/unn4m3d/mixin/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

mixin

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • almost 8 years ago
  • January 7, 2017
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 07:22:34 GMT

Languages