Sha256: 3241836d11bfb93a9e50888c2958617848184eea6f3df7d75b54ed7ad53b7366

Contents?: true

Size: 260 Bytes

Versions: 3

Compression:

Stored size: 260 Bytes

Contents

module Basic101

  class LenFunction < Function

    def name
      'LEN'
    end

    def call(runtime, args)
      check_args args, [BasicString]
      string = args.first
      string = string.eval(runtime).to_string
      string.length
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-0.4.0 lib/basic101/len_function.rb
basic101-0.2.0 lib/basic101/len_function.rb
basic101-0.1.0 lib/basic101/len_function.rb