module Pione::Global::ValueConverter

Public Class Methods

convert(type, val) click to toggle source
# File lib/pione/global/item.rb, line 177
def self.convert(type, val)
  case type
  when :string
    val = val.to_s unless val.kind_of?(String)
  when :integer
    val = val.to_i unless val.kind_of?(Integer)
  when :boolean
    val = val == "true" ? true : false unless val == true or val == false
  end

  return val
end