Class: Morpheus::Response

Inherits:
Typhoeus::Response
  • Object
show all
Defined in:
lib/morpheus/response.rb

Instance Method Summary collapse

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

Returns:

  • (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

Returns:

  • (Boolean)


19
20
21
# File 'lib/morpheus/response.rb', line 19

def tagged_for_caching?
  @tagged_for_caching ||= false
end