No commit activity in last 3 years
No release in over 3 years
Chaining methods on classes and objects until you decide to retrieve the value
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
 Project Readme

Method Chainable

The idea here is easy chaining of methods on classes or objects in Ruby. Primarily it routes output from one method to the next Screenshot

Installation

Add this line to your application's Gemfile:

gem 'method_chainable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install method_chainable

Usage

Consider this simple example

class Simpleton
  include MethodChainable

  def foo
    'Foo'
  end

  def bar(n)
    n + 'Bar'
  end
end

# Without chaining
s = Simpleton.new
s.bar(s.foo) # FooBar

# With chaining(You should call .val to get the final result)
Simpleton.new.chain.foo.bar.val # FooBar

Contributing

  1. Fork it ( https://github.com/abhisheksarka/method_chainable/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