class Chained::DSL

Public Class Methods

new() click to toggle source
# File lib/chained.rb, line 5
def initialize
        @chain = []
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
# File lib/chained.rb, line 9
def method_missing(name, *args, &block)
        @chain << [name, args, block]
        self
end
to_proc() click to toggle source
# File lib/chained.rb, line 14
def to_proc
        Proc.new do |val|
                @chain.each do |method_name, args, block|
                        val = val.send method_name, *args, &block
                end

                val
        end
end