Class: OpenQq::Request

Inherits:
Gateway show all
Defined in:
lib/open_qq/request.rb

Constant Summary

Constants inherited from Gateway

Gateway::OPEN_HTTP_TRANSLATE_ERROR

Instance Attribute Summary collapse

Attributes inherited from Gateway

#appid, #appkey, #env

Instance Method Summary collapse

Methods inherited from Gateway

#wrap

Methods included from Signature

#each_pair_escape, #make_callback_source, #make_source, #parsed_params, #signature, #url_escape, #verify_sig

Constructor Details

#initialize(options) ⇒ Request

Returns a new instance of Request.



14
15
16
17
18
19
20
21
22
# File 'lib/open_qq/request.rb', line 14

def initialize(options)
  options  = options.dup
  appid    = options.delete(:appid)
  appkey   = options.delete(:appkey)
  env      = options.delete(:env)
  @url     = options.delete(:url)
  @options = options || {}
  super(appid, appkey, env)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



12
13
14
# File 'lib/open_qq/request.rb', line 12

def options
  @options
end

#urlObject

Returns the value of attribute url.



12
13
14
# File 'lib/open_qq/request.rb', line 12

def url
  @url
end

Instance Method Details

#get(params = {}, options = nil) ⇒ Object

See Also:



25
26
27
28
# File 'lib/open_qq/request.rb', line 25

def get(params = {}, options = nil)
  options ||= @options
  super(@url, params, options)
end

#post(params = {}, options = nil) ⇒ Object

See Also:



31
32
33
34
# File 'lib/open_qq/request.rb', line 31

def post(params = {}, options = nil)
  options ||= @options
  super(@url, params, options)
end