Class: WIS::Client::Tools

Inherits:
Object
  • Object
show all
Defined in:
lib/client/tools.rb

Class Method Summary collapse

Class Method Details

.get_json(url) ⇒ Object



2
3
4
5
# File 'lib/client/tools.rb', line 2

def self.get_json(url)
	resp = Net::HTTP.get_response(URI.parse(url))
	Yajl::Parser.parse(resp.body)
end

.uri_escape(string) ⇒ Object



7
8
9
# File 'lib/client/tools.rb', line 7

def self.uri_escape(string)
	URI.escape(string, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
end