Class: Morpheus::Response
- Inherits:
-
Typhoeus::Response
- Object
- Typhoeus::Response
- Morpheus::Response
- Defined in:
- lib/morpheus/response.rb
Instance Method Summary collapse
- #cached? ⇒ Boolean
-
#initialize(params = {}, cached = false) ⇒ Response
constructor
A new instance of Response.
- #tag_for_caching! ⇒ Object
- #tagged_for_caching? ⇒ Boolean
Constructor Details
#initialize(params = {}, cached = false) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/morpheus/response.rb', line 4 def initialize(params = {}, cached = false) super(params) @cached = cached end |
Instance Method Details
#cached? ⇒ Boolean
9 10 11 12 13 |
# File 'lib/morpheus/response.rb', line 9 def cached? !!@cached.tap do @cached = tagged_for_caching? end end |
#tag_for_caching! ⇒ Object
15 16 17 |
# File 'lib/morpheus/response.rb', line 15 def tag_for_caching! @tagged_for_caching = true end |
#tagged_for_caching? ⇒ Boolean
19 20 21 |
# File 'lib/morpheus/response.rb', line 19 def tagged_for_caching? @tagged_for_caching ||= false end |