Sha256: 8940c9b79d38fc7811cd3cfc333db0c89bd1c3fbc7045b7eac9fedb0255b2b59

Contents?: true

Size: 266 Bytes

Versions: 3

Compression:

Stored size: 266 Bytes

Contents

# frozen_string_literal: true

module Basic101

  class IntFunction < Function

    def name
      'INT'
    end

    def call(runtime, args)
      check_args args, [BasicNumeric]
      value = args.first.eval(runtime)
      value.to_float.floor
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-1.0.2 lib/basic101/int_function.rb
basic101-1.0.1 lib/basic101/int_function.rb
basic101-1.0.0 lib/basic101/int_function.rb