class Wiris::Std

Public Class Methods

charCodeAt(str, i) click to toggle source
# File lib/src-generic/Std.rb, line 40
def self.charCodeAt(str, i)
            return str[i].ord
end
fromCharCode(c) click to toggle source
# File lib/src-generic/Std.rb, line 36
def self.fromCharCode(c)
            return c.chr(Encoding::UTF_8)
end
is(o, cls) click to toggle source
# File lib/src-generic/Std.rb, line 7
def self.is(o, cls)
         raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end
parseFloat(number) click to toggle source
# File lib/src-generic/Std.rb, line 27
def self.parseFloat(number)
        return Float(number)
end
parseInt(number) click to toggle source
# File lib/src-generic/Std.rb, line 23
def self.parseInt(number)
        return Integer(number)
end
random(x) click to toggle source
# File lib/src-generic/Std.rb, line 66
def self.random(x) 
  if @@random == nil
   @@random = Random.new()
  end
  return @@random.rand(x)
end
random=(random) click to toggle source
# File lib/src-generic/Std.rb, line 63
def self.random=(random)
   @@random=random
end
split(str, delimitator) click to toggle source
# File lib/src-generic/Std.rb, line 56
def self.split(str, delimitator)
   arr = Array.new()
   str.split(delimitator).each {|x| arr.push(x)}
            return arr
end
substr(text, x0, length=-1) click to toggle source
# File lib/src-generic/Std.rb, line 11
def self.substr(text, x0, length=-1)
        if length==-1
                text[x0..text.length]
        else
                text[x0,length] # Strings starts at 0
        end
end
trace(s) click to toggle source
# File lib/src-generic/Std.rb, line 3
def self.trace(s)
        puts s
end

Public Instance Methods

copyInto(array, cs) click to toggle source
# File lib/src-generic/Std.rb, line 44
def copyInto(array, cs)
            raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end
exit(n) click to toggle source
# File lib/src-generic/Std.rb, line 48
def exit(n)
            raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end
parseDouble(number) click to toggle source

@deprecated

# File lib/src-generic/Std.rb, line 32
def parseDouble(number)
            raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end
random(x) click to toggle source
# File lib/src-generic/Std.rb, line 52
def random(x)
            raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end
split(text, delimitator) click to toggle source
# File lib/src-generic/Std.rb, line 19
def split(text, delimitator)
        raise Exception,'Error: '+ __callee__.to_s  + ' method not defined'
end