Class: Basic101::LenFunction
- Defined in:
- lib/basic101/len_function.rb
Instance Method Summary collapse
Methods inherited from Function
Instance Method Details
#call(runtime, args) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/basic101/len_function.rb', line 11 def call(runtime, args) check_args args, [BasicString] string = args.first string = string.eval(runtime).to_string string.length end |
#name ⇒ Object
7 8 9 |
# File 'lib/basic101/len_function.rb', line 7 def name 'LEN' end |