Class: Wiris::TypeTools

Inherits:
Object
  • Object
show all
Defined in:
lib/src-generic/TypeTools.rb

Class Method Summary collapse

Class Method Details

.floatToString(float) ⇒ Object



4
5
6
# File 'lib/src-generic/TypeTools.rb', line 4

def self.floatToString(float)
  return float.to_s
end

.isArray(o) ⇒ Object



24
25
26
# File 'lib/src-generic/TypeTools.rb', line 24

def self.isArray(o)
  return o.instance_of? Array
end

.isFloating(str) ⇒ Object



8
9
10
# File 'lib/src-generic/TypeTools.rb', line 8

def self.isFloating(str)
  Float(str) rescue false
end

.isHash(o) ⇒ Object



28
29
30
# File 'lib/src-generic/TypeTools.rb', line 28

def self.isHash(o)
  return o.instance_of? Hash
end

.isIdentifierPart(int) ⇒ Object



16
17
18
# File 'lib/src-generic/TypeTools.rb', line 16

def self.isIdentifierPart(int)
  return (int.chr.match(/^[[:alpha:]]$/) ? true : false) || (int.chr.match(/^[[:digit:]]$/) ? true : false) || int.chr == '_'
end

.isIdentifierStart(int) ⇒ Object



20
21
22
# File 'lib/src-generic/TypeTools.rb', line 20

def self.isIdentifierStart(int)
  return (int.chr.match(/^[[:alpha:]]$/) ? true : false) || int.chr == '_'
end

.isInteger(str) ⇒ Object



12
13
14
# File 'lib/src-generic/TypeTools.rb', line 12

def self.isInteger(str)
  Integer(str) rescue false
end