module SQLite3ExtendFunction::Functions::Ascii

SQLite3ExtendFunction::Functions::Ascii

Public Class Methods

call(str) click to toggle source

@param [String] str @return [Integer] @raise [SQLite3::SQLException]

# File lib/sqlite3_extend_function/functions/ascii.rb, line 11
def call(str)
  str.is_a?(String) ? str.ord : (raise ArgumentError)
rescue ArgumentError
  raise SQLite3::SQLException, 'No function matches the given name and argument types. ' \
    'You might need to add explicit type casts.'
end