Class: GemChangelogDiff::CachedResponse
- Inherits:
-
Object
- Object
- GemChangelogDiff::CachedResponse
- Defined in:
- lib/gem_changelog_diff/cache.rb
Overview
Lightweight stand-in for Net::HTTPResponse built from cached data.
Instance Attribute Summary collapse
- #body ⇒ String readonly
- #code ⇒ String readonly
Instance Method Summary collapse
- #[](_header) ⇒ Object
-
#initialize(body, code) ⇒ CachedResponse
constructor
A new instance of CachedResponse.
- #is_a?(klass) ⇒ Boolean
Constructor Details
#initialize(body, code) ⇒ CachedResponse
Returns a new instance of CachedResponse.
120 121 122 123 |
# File 'lib/gem_changelog_diff/cache.rb', line 120 def initialize(body, code) @body = body @code = code end |
Instance Attribute Details
#body ⇒ String (readonly)
118 119 120 |
# File 'lib/gem_changelog_diff/cache.rb', line 118 def body @body end |
#code ⇒ String (readonly)
118 119 120 |
# File 'lib/gem_changelog_diff/cache.rb', line 118 def code @code end |
Instance Method Details
#[](_header) ⇒ Object
131 132 133 |
# File 'lib/gem_changelog_diff/cache.rb', line 131 def [](_header) nil end |
#is_a?(klass) ⇒ Boolean
125 126 127 128 129 |
# File 'lib/gem_changelog_diff/cache.rb', line 125 def is_a?(klass) return true if klass == Net::HTTPSuccess && @code.start_with?("2") super end |