Sha256: 98bc31e9dd91904e395970ff1f4e7ecfef75b930e08f10eeef7bc784717d4c72

Contents?: true

Size: 235 Bytes

Versions: 3

Compression:

Stored size: 235 Bytes

Contents

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-0.4.0 lib/basic101/int_function.rb
basic101-0.2.0 lib/basic101/int_function.rb
basic101-0.1.0 lib/basic101/int_function.rb