Sha256: 7af1638ca7138f9974b14d74a80ba61b5329987f9d7ee16a34902e9d9157f948

Contents?: true

Size: 594 Bytes

Versions: 22

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

require_relative '../../logic/cartridge/affixes'

module NanoBot
  module Controllers
    module Interfaces
      module Eval
        def self.evaluate(input, cartridge, session, mode)
          prefix = Logic::Cartridge::Affixes.get(cartridge, mode.to_sym, :output, :prefix)
          suffix = Logic::Cartridge::Affixes.get(cartridge, mode.to_sym, :output, :suffix)

          session.print(prefix) unless prefix.nil?

          session.evaluate_and_print(input, mode:)

          session.print(suffix) unless suffix.nil?
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
nano-bots-3.4.0 controllers/interfaces/eval.rb
nano-bots-3.3.0 controllers/interfaces/eval.rb
nano-bots-3.2.0 controllers/interfaces/eval.rb
nano-bots-3.0.1 controllers/interfaces/eval.rb
nano-bots-3.0.0 controllers/interfaces/eval.rb
nano-bots-2.5.1 controllers/interfaces/eval.rb
nano-bots-2.5.0 controllers/interfaces/eval.rb
nano-bots-2.4.1 controllers/interfaces/eval.rb
nano-bots-2.4.0 controllers/interfaces/eval.rb
nano-bots-2.3.0 controllers/interfaces/eval.rb
nano-bots-2.2.0 controllers/interfaces/eval.rb
nano-bots-2.1.0 controllers/interfaces/eval.rb
nano-bots-2.0.0 controllers/interfaces/eval.rb
nano-bots-1.2.0 controllers/interfaces/eval.rb
nano-bots-1.1.2 controllers/interfaces/eval.rb
nano-bots-1.1.1 controllers/interfaces/eval.rb
nano-bots-1.1.0 controllers/interfaces/eval.rb
nano-bots-1.0.1 controllers/interfaces/eval.rb
nano-bots-1.0.0 controllers/interfaces/eval.rb
nano-bots-0.1.1 controllers/interfaces/eval.rb