class Function

Attributes

input_variables[RW]
output_variables[RW]
string_from_discord[RW]

Public Class Methods

new() click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 86
def initialize
  self.input_variables = []
  self.output_variables = []
end

Public Instance Methods

compute(*args) click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 98
def compute(*args)
  if @compute_type
    case @compute_type
    when :convert_to_integer_then_sum
      return args.map(&:to_i).reduce(:+)
    when :sum
      return args.public_send(@compute_type)
    end 
  end

  return args
end
compute_is(compute_type) click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 111
def compute_is(compute_type)
  @compute_type = compute_type
end
evaluate() click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 91
def evaluate
  case string_from_discord
  when "NeuralNetwork()"
    return NeuralNetwork().verbose_introspect(very_verbose=true)
  end
end
explain() click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 119
def explain
  """
    This command creates a new function ƒ(x) = y

    ƒ

    Mac OS X: press option and f simultaniously
    Windows:
      On a computer running Microsoft Windows and using the Windows-1252 character encoding, the minuscule can be input using alt+159 or alt+0131.
      Look up at wikipedia and search for ƒ
    Linux:
      Copy & Paste ƒ (maybe a clipboard manager?) ofc you rule the world
  """
end
to_s() click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 115
def to_s
  "Function"
end