Class: Keiyaku::ByStatus

Inherits:
Object
  • Object
show all
Defined in:
sig/keiyaku.rbs,
lib/keiyaku/runtime.rb

Overview

Several success responses that are several types:

into: ByStatus[200 => PagesHealthCheck, 202 => EmptyObject]

Not a type — nothing casts into one of these — but the thing an operation's into: is when the document gave more than one answer. The document says which type belongs to which status and the response carries the status, so the choice is read rather than guessed. A status the document did not describe is left alone, since the alternative is a CastError naming a type the server never claimed to be sending.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(types) ⇒ ByStatus

Returns a new instance of ByStatus.

Parameters:

  • (Hash[Integer | String, untyped])


115
# File 'sig/keiyaku.rbs', line 115

def initialize: (Hash[Integer | String, untyped]) -> void

Instance Attribute Details

#typesHash[Integer | String, untyped] (readonly)

Returns:

  • (Hash[Integer | String, untyped])


117
# File 'sig/keiyaku.rbs', line 117

def types: () -> Hash[Integer | String, untyped]

Class Method Details

.[](types) ⇒ ByStatus

Parameters:

  • types (Hash[Integer | String, untyped])

Returns:



114
# File 'sig/keiyaku.rbs', line 114

def self.[]: (Hash[Integer | String, untyped] types) -> ByStatus

Instance Method Details

#[](status) ⇒ Object

Parameters:

  • status (Integer)

Returns:

  • (Object)


116
# File 'sig/keiyaku.rbs', line 116

def []: (Integer status) -> untyped