Sha256: ffc7c30c6a2c40db4011807ba0e81d00a0cac1c452dc2325d19db1ad8f730546
Contents?: true
Size: 1.3 KB
Versions: 3
Compression:
Stored size: 1.3 KB
Contents
# encoding: utf-8 module Axiom class Function class Numeric # A class representing an addition function class Addition < Numeric include Comparable, Binary # 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 Axiom
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.2.0 | lib/axiom/function/numeric/addition.rb |
axiom-0.1.1 | lib/axiom/function/numeric/addition.rb |
axiom-0.1.0 | lib/axiom/function/numeric/addition.rb |