Class: SFRest::Pathbuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/sfrest/pathbuilder.rb

Overview

make a url querypath so that if the are multiple items in a get request we can get a path like /api/v1/foo?bar=boo&bat=gah …

Instance Method Summary collapse

Instance Method Details

#build_url_query(current_path, datum = nil) ⇒ Object

build a get query

Parameters:

  • current_path (String)

    the uri like /api/v1/foo

  • datum (Hash) (defaults to: nil)

    k,v hash of get query param and value



11
12
13
14
15
16
17
# File 'lib/sfrest/pathbuilder.rb', line 11

def build_url_query(current_path, datum = nil)
  unless datum.nil?
    current_path += '?'
    current_path += URI.encode_www_form datum
  end
  current_path
end