Class: Basic101::IntFunction

Inherits:
Function show all
Defined in:
lib/basic101/int_function.rb

Instance Method Summary collapse

Methods inherited from Function

#check_args

Instance Method Details

#call(runtime, args) ⇒ Object



9
10
11
12
13
# File 'lib/basic101/int_function.rb', line 9

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

#nameObject



5
6
7
# File 'lib/basic101/int_function.rb', line 5

def name
  'INT'
end