Class Wrest::Native::Get

  1. lib/wrest/native/get.rb

Attributes

cache_proxy [R]

Public class methods

new (wrest_uri, parameters = {}, headers = {}, options = {})
[show source]
    # File lib/wrest/native/get.rb, line 14
14:     def initialize(wrest_uri, parameters = {}, headers = {}, options = {})
15:       follow_redirects = options[:follow_redirects]
16:       options[:follow_redirects] = (follow_redirects == nil ? true : follow_redirects)
17: 
18:       cache_store = (options[:cache_store] || Wrest.default_cachestore) unless options[:disable_cache]
19:       @cache_proxy = Wrest::CacheProxy::new(self, cache_store)
20:       
21:       super(
22:             wrest_uri,
23:             Net::HTTP::Get,
24:             parameters,
25:             nil,
26:             headers,
27:             options
28:           )
29:     end

Public instance methods

== (other)

Checks equality between two Wrest::Native::Get objects. Comparing two Wrest::Native::Get objects with identical values for the following properties would return True.

uri, parameters, username, password and ssh verify_mode.
[show source]
    # File lib/wrest/native/get.rb, line 34
34:     def ==(other)
35:       return true if self.equal?(other)
36:       return false unless other.class == self.class
37:       return true if self.uri == other.uri and
38:         self.parameters == other.parameters and
39:         self.username == other.username and
40:         self.password == other.password and
41:         self.verify_mode == other.verify_mode
42:       false
43:     end
build_request_without_cache_store (cache_validation_headers)
[show source]
    # File lib/wrest/native/get.rb, line 58
58:     def build_request_without_cache_store(cache_validation_headers)
59:       new_headers = headers.clone.merge cache_validation_headers
60:       new_options = options.clone.tap { |opts| opts.delete :cache_store; opts[:disable_cache] = true } # do not run this through the caching mechanism.
61: 
62:       new_request = Wrest::Native::Get.new(uri, parameters, new_headers, new_options)
63:       new_request
64:     end
hash ()

Returns a hash value for this Wrest::Native::Get object. Objects that returns true when compared using the == operator would return the same hash value also.

[show source]
    # File lib/wrest/native/get.rb, line 47
47:     def hash
48:       self.uri.hash + self.parameters.hash + self.username.hash + self.password.hash + self.verify_mode.hash + 20110106
49:     end
invoke_with_cache_check ()

:nodoc:

[show source]
    # File lib/wrest/native/get.rb, line 52
52:     def invoke_with_cache_check
53:       cache_proxy.get
54:     end