def pipe(object, methods = [])
      methods.reduce(object) do |acc, method|
        case method
        when Proc || method.respond_to?(:call)
          method.call(acc)
        when Symbol
          send(method, acc)
        when String
          raise "must start with '.'" unless method[0] == '.'
          acc.send(method[1..-1].to_sym)
        else
          raise "unexpected pipe #{method}"
        end
      end
    end
def pipe(object, methods = [])
      methods.reduce(object) do |acc, method|
        case method
        when Proc || method.respond_to?(:call)
          method.call(acc)
        when Symbol
          send(method, acc)
        when String
          raise "must start with '.'" unless method[0] == '.'
          acc.send(method[1..-1].to_sym)
        else
          raise "unexpected pipe #{method}"
        end
      end
    end
Applies methods/procs to an object in order