class DeprecationAnalysis

Attributes

expected_sunset_value[R]
status[R]
sunset_value[R]

Public Class Methods

new(rspec_api_documentation_context, gone_on) click to toggle source
# File lib/stitches/spec/show_deprecation.rb, line 3
def initialize(rspec_api_documentation_context, gone_on)
  gone_on_date = Date.parse(gone_on)
  if gone_on_date > Date.today
    @expecting_sunset      = true
    @expected_sunset_value = gone_on_date.in_time_zone("GMT").midnight.strftime("%a, %e %b %Y %H:%M:%S %Z")
    @sunset_header_set     = rspec_api_documentation_context.response_headers["Sunset"].present?
    @sunset_value          = rspec_api_documentation_context.response_headers["Sunset"]
    @sunset_header_match   = @expected_sunset_value == @sunset_value
  else
    @expecting_gone = true
    @status         = rspec_api_documentation_context.status
    @gone           = @status == 410
  end
end

Public Instance Methods

expecting_sunset?() click to toggle source
# File lib/stitches/spec/show_deprecation.rb, line 18
def expecting_sunset?;    !!@expecting_sunset;    end
gone?() click to toggle source
# File lib/stitches/spec/show_deprecation.rb, line 21
def gone?;                !!@gone;                end
sunset_header_match?() click to toggle source
# File lib/stitches/spec/show_deprecation.rb, line 20
def sunset_header_match?; !!@sunset_header_match; end
sunset_header_set?() click to toggle source
# File lib/stitches/spec/show_deprecation.rb, line 19
def sunset_header_set?;   !!@sunset_header_set;   end