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

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

Constructor Details

#initialize(options) ⇒ Request

Returns a new instance of Request



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

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



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

def options
  @options
end

#urlObject

Returns the value of attribute url



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

def url
  @url
end

Instance Method Details

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

See Also:



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

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

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

See Also:



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

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