Sha256: 33f51efc63f4968ea9ef3d35b8c000d778d2093c714ae59622fcd0d52e1aed98

Contents?: true

Size: 500 Bytes

Versions: 1

Compression:

Stored size: 500 Bytes

Contents

require 'beethoven/version'
require 'beethoven/composer'

# The Beethoven module can be used in order to provide convenience operators for
# the Beethoven::Composer class.
module Beethoven
  refine Object do
    def *(other)
      Beethoven::Composer.new(other, self)
    end

    def |(other)
      Beethoven::Composer.new(self, other)
    end
  end

  refine Proc do
    def *(other)
      -> x { call(other.call(x)) }
    end

    def |(other)
      -> x { other.call(call(x)) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beethoven-0.1.0 lib/beethoven.rb