Top Level Namespace

Defined Under Namespace

Modules: MultiForecast

Instance Method Summary collapse

Methods included from MultiForecast::ConversionRule

#graph_name, #id, #ids, #lstrip, #path, #section_name, #service_name, #uri_escape, #uri_unescape

Instance Method Details

#base_uriObject



15
16
17
# File 'lib/multiforecast/shared_context.rb', line 15

def base_uri
  'http://localhost:5125'
end

#e(str) ⇒ Object



7
8
9
# File 'lib/multiforecast/shared_context.rb', line 7

def e(str)
  CGI.escape(str).gsub('+', '%20') if str
end

#gfpath(path) ⇒ Object



11
12
13
# File 'lib/multiforecast/shared_context.rb', line 11

def gfpath(path)
  "#{e service_name(path)}/#{e section_name(path)}/#{e graph_name(path)}"
end

#multiforecast(opts = {}) ⇒ Object



19
20
21
22
# File 'lib/multiforecast/shared_context.rb', line 19

def multiforecast(opts = {})
  opts['mapping'] ||= { '' => base_uri }
  MultiForecast::Client.new(opts)
end