class HSharedData

Public Class Methods

new() click to toggle source
# File lib/hengine/hshareddata.rb, line 9
def initialize()

  @sharedData = Hash.new

end
test1() click to toggle source
# File lib/hengine/hshareddata.rb, line 44
def self.test1()

  HSharedData.instance().setValue("wien", "best_city")
  puts HSharedData.instance().value("best_city")

end

Public Instance Methods

set(fieldName, fieldValue, sharedDataName = 'default') click to toggle source
# File lib/hengine/hshareddata.rb, line 30
def set(fieldName, fieldValue, sharedDataName = 'default')
  self.setValue(fieldValue, fieldName, sharedDataName)
end
setValue(fieldValue, fieldName, sharedDataName = "default") click to toggle source
# File lib/hengine/hshareddata.rb, line 20
def setValue(fieldValue, fieldName, sharedDataName = "default")
  
  #puts "=======> setValue(#{fieldValue}, #{fieldName})".hight_cyan
  if(fieldValue == nil)
    self.sharedData(sharedDataName).delete(fieldName)
  else 
    self.sharedData(sharedDataName)[fieldName] = fieldValue
  end
end
sharedData(sharedDataName) click to toggle source
# File lib/hengine/hshareddata.rb, line 15
def sharedData(sharedDataName)
  @sharedData[sharedDataName] = Hash.new() unless (@sharedData[sharedDataName])
  return @sharedData[sharedDataName]
end
show() click to toggle source
# File lib/hengine/hshareddata.rb, line 40
def show()
  #p "=======> @sharedData: #{@sharedData}"
end
value(fieldName, sharedDataName = "default") click to toggle source
# File lib/hengine/hshareddata.rb, line 34
def value(fieldName, sharedDataName = "default")

  return self.sharedData(sharedDataName)[fieldName]

end