Sha256: 77d5ee6a7a1779ec6f2f965bed50e95c779168e064c67cb6fe2248fae7a8f357

Contents?: true

Size: 358 Bytes

Versions: 1

Compression:

Stored size: 358 Bytes

Contents

module StreetFighter
  class Right < EitherValue
    def match other
      EitherCheck.new(other).run!
      other
    end

    def tournament *fns
      return self if fns.empty?

      bind(fns.first).tap do |result|
        EitherCheck.new(result).run!
      end.tournament(*fns[1..-1])
    end

    def bind func
      func.call(value)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
street_fighter-0.0.1 lib/street_fighter/right.rb