Class: Wiris::PropertiesTools

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

Class Method Summary collapse

Class Method Details

.fromProperties(prop) ⇒ Object



29
30
31
# File 'lib/src-generic/PropertiesTools.rb', line 29

def self.fromProperties(prop)
    return prop
end

.getProperty(prop, key, dflt = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/src-generic/PropertiesTools.rb', line 3

def self.getProperty(prop, key, dflt=nil)
	if (!prop[key].nil?)
		return prop[key]
	else
		return dflt
	end
end

.newPropertiesObject



15
16
17
# File 'lib/src-generic/PropertiesTools.rb', line 15

def self.newProperties()
	return Hash.new()
end

.setProperty(prop, key, value) ⇒ Object



11
12
13
# File 'lib/src-generic/PropertiesTools.rb', line 11

def self.setProperty(prop, key, value)
	prop[key] = value
end

.toProperties(hashString) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/src-generic/PropertiesTools.rb', line 19

def self.toProperties(hashString)
    p = Hash.new()
    keys = hashString.keys()
    while keys.hasNext()
    	key = keys.next()
    	p[key] = hashString.get(key)
    end
    return p
end