Class: GemChangelogDiff::CachedResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_changelog_diff/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, code) ⇒ CachedResponse

Returns a new instance of CachedResponse.



107
108
109
110
# File 'lib/gem_changelog_diff/cache.rb', line 107

def initialize(body, code)
  @body = body
  @code = code
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



105
106
107
# File 'lib/gem_changelog_diff/cache.rb', line 105

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



105
106
107
# File 'lib/gem_changelog_diff/cache.rb', line 105

def code
  @code
end

Instance Method Details

#[](_header) ⇒ Object



118
119
120
# File 'lib/gem_changelog_diff/cache.rb', line 118

def [](_header)
  nil
end

#is_a?(klass) ⇒ Boolean

Returns:

  • (Boolean)


112
113
114
115
116
# File 'lib/gem_changelog_diff/cache.rb', line 112

def is_a?(klass)
  return true if klass == Net::HTTPSuccess && @code.start_with?("2")

  super
end