Sha256: 3a6696e2cbe966a78544fb3db3441b2c3d7bb39b282157eeddda7d345bf96a53

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

module Mathy
  module Operations
    class Operation
      attr_reader :key

      def initialize(verification, key)
        @verifier = verification
        @key = key
      end

      def play_turn(operands)
        @verifier.check_answer("#{operands.join(" #{key} ")} = ", calculate(operands))
      end

      def matches?(other_key)
        key == other_key
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mathy-0.0.1 lib/mathy/operations/operation.rb