Sha256: f5991b3b1f25c296a409b69d1689809d202448985a1ec2c5ca54a0062440d6bd

Contents?: true

Size: 401 Bytes

Versions: 3

Compression:

Stored size: 401 Bytes

Contents

module Dydx
  class Function
    attr_accessor :algebra, :vars
    def initialize(*vars)
      @vars = vars
    end

    def <=(algebra)
      @algebra = algebra
      self
    end

    def differentiate(sym = :x)
      @algebra.differentiate(sym)
    end
    alias_method :d, :differentiate

    def to_s
      algebra.to_s
    end

    def ==(function)
      to_s == function.to_s
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dydx-0.1.41421 lib/dydx/function.rb
dydx-0.1.412 lib/dydx/function.rb
dydx-0.1.4 lib/dydx/function.rb