Module: Ucb::Hcm::Request

Included in:
Api
Defined in:
lib/ucb/hcm/request.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



7
8
9
# File 'lib/ucb/hcm/request.rb', line 7

def client
  HTTParty
end

#get(*args) ⇒ Object



11
12
13
14
15
16
# File 'lib/ucb/hcm/request.rb', line 11

def get(*args)
  resource = format_resource(args.shift)
  resource += "?#{format_get_params(*args)}" if !args.empty?
  params = default_options
  respond client.get(resource, params)
end

#post(*args) ⇒ Object



18
19
20
21
22
# File 'lib/ucb/hcm/request.rb', line 18

def post(*args)
  resource = format_resource(args.shift)
  params = format_post_params(*args)
  respond client.post(resource, params)
end

#respond(response) ⇒ Object



24
25
26
# File 'lib/ucb/hcm/request.rb', line 24

def respond( response )
  Response.new response
end