Class: R2OAS::Schema::V3::PathItemObject::HttpStatusManager

Inherits:
Object
  • Object
show all
Defined in:
lib/r2-oas/schema/v3/object/path_item_object.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, verb, http_statuses_when_http_method) ⇒ HttpStatusManager

Returns a new instance of HttpStatusManager.



153
154
155
156
157
# File 'lib/r2-oas/schema/v3/object/path_item_object.rb', line 153

def initialize(path, verb, http_statuses_when_http_method)
  @path_comp                      = Routing::PathComponent.new(path)
  @verb                           = verb
  @http_statuses_when_http_method = http_statuses_when_http_method
end

Instance Method Details

#http_statusesObject



159
160
161
162
# File 'lib/r2-oas/schema/v3/object/path_item_object.rb', line 159

def http_statuses
  key = @path_comp.exist_path_parameters? ? :path_parameter : :default
  @http_statuses_when_http_method[@verb.to_sym][key]
end