module PipeOperator

Public Class Methods

gem() click to toggle source
   # File lib/pipe_operator.rb
18 def gem
19   @gem ||= ::Gem::Specification.load("#{root}/pipe_operator.gemspec")
20 end
inspect(object) click to toggle source
   # File lib/pipe_operator.rb
22 def inspect(object)
23   object.inspect
24 rescue ::NoMethodError
25   singleton = singleton(object)
26   name = singleton.name || singleton.superclass.name
27   id = "0x0000%x" % (object.__id__ << 1)
28   "#<#{name}:#{id}>"
29 end
root() click to toggle source
   # File lib/pipe_operator.rb
31 def root
32   @root ||= ::Pathname.new(__dir__).join("..")
33 end
singleton(object) click to toggle source
   # File lib/pipe_operator.rb
35 def singleton(object)
36   (class << object; self end)
37 rescue ::TypeError
38   object.class
39 end
version() click to toggle source
   # File lib/pipe_operator.rb
41 def version
42   @version ||= gem.version.to_s
43 end

Public Instance Methods

__pipe__(*args, &block) click to toggle source
   # File lib/pipe_operator.rb
13 def __pipe__(*args, &block)
14   Pipe.new(self, *args, &block)
15 end