Sha256: b78c479578618a46417cb0ae270808e12473791953abcdad77430ac0a6dd7a20
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
# encoding: utf-8 module Axiom class Function class Predicate # A predicate representing an inclusion test class Inclusion < Predicate include Enumerable # Test an enumerable to see if a value is included # # @example # Inclusion.call(1, [ 1, 2, 3 ]) # => true # # @param [Object] left # the object to test for in the Enumerable # @param [Enumerable] right # the enumerable to test # # @return [Boolean] # # @api public def self.call(left, right) right.send(Enumerable.compare_method(right), left) end # Return the inverse predicate class # # @example # Inclusion.inverse # => Exclusion # # @return [Class<Exclusion>] # # @api public def self.inverse Exclusion end module Methods # Compare the left to see if it is included in the right # # @example # inclusion = attribute.include([ 1, 2, 3 ]) # # @param [Function] other # # @return [Inclusion] # # @api public def include(other) Inclusion.new(self, other) end end # module Methods end # class Inclusion end # class Predicate end # class Function end # module Axiom
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.1.0 | lib/axiom/function/predicate/inclusion.rb |