Class: Basic101::LeftFunction
- Defined in:
- lib/basic101/left_function.rb
Instance Method Summary collapse
Methods inherited from Function
Instance Method Details
#call(runtime, args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/basic101/left_function.rb', line 9 def call(runtime, args) check_args args, [BasicString, BasicNumeric] string, count = *args string = string.eval(runtime).to_string count = count.eval(runtime).to_integer string.left(count) end |
#name ⇒ Object
5 6 7 |
# File 'lib/basic101/left_function.rb', line 5 def name 'LEFT$' end |