module GlobalWeather::Utils
Public Class Methods
local_wsdl_file()
click to toggle source
Returns local copy of wsdl schema file
# File lib/global_weather/utils.rb, line 5 def self.local_wsdl_file current_file = File.expand_path(File.dirname(__FILE__)) File.open(File.join(current_file,'..','..','wsdl','globalweather.asmx.xml')) end
Public Instance Methods
camelize(lower_case_and_underscored_word)
click to toggle source
Camelize input string
# File lib/global_weather/utils.rb, line 11 def camelize(lower_case_and_underscored_word) lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } end
fix_header!(string_xml)
click to toggle source
Removes <?xml … /xml> header from xml string
# File lib/global_weather/utils.rb, line 16 def fix_header!(string_xml) string_xml.gsub!(/\<\?.+\?\>/,'') end