Sha256: 660776e8ca208743978eefbdedcfb4ea65798590f1ecdd9ba2e0719a0b7e6fd6
Contents?: true
Size: 1.3 KB
Versions: 4
Compression:
Stored size: 1.3 KB
Contents
# encoding: utf-8 module Veritas class Function class Numeric # A class representing an addition function class Addition < Numeric include Binary, Comparable # Return the Addition operation # # @example # Addition.operation # => :+ # # @return [Symbol] # # @api public def self.operation :+ end # Return the inverse function class # # @example # Addition.inverse # => Subtraction # # @return [Class<Subtraction>] # # @api public def self.inverse Subtraction end module Methods extend Aliasable inheritable_alias(:+ => :add) # Return an addition function # # @example # addition = attribute.add(other) # # @param [Object] other # # @return [Addition] # # @api public def add(other) Addition.new(self, other) end end # module Methods Attribute::Numeric.class_eval { include Methods } Numeric.class_eval { include Methods } end # class Addition end # class Numeric end # class Function end # module Veritas
Version data entries
4 entries across 4 versions & 1 rubygems