Class: Spikard::Response

Inherits:
Object
  • Object
show all
Defined in:
sig/types.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.

Parameters:

  • content: (json_value)
  • status_code: (Integer)
  • headers: (Hash[String, String])


196
# File 'sig/types.rbs', line 196

def initialize: (?content: json_value, ?status_code: Integer, ?headers: Hash[String, String]) -> void

Instance Attribute Details

#contentjson_value?

Returns the value of attribute content.

Returns:

  • (json_value, nil)


192
193
194
# File 'sig/types.rbs', line 192

def content
  @content
end

#headersHash[String, String]?

Returns the value of attribute headers.

Returns:

  • (Hash[String, String], nil)


194
195
196
# File 'sig/types.rbs', line 194

def headers
  @headers
end

#status_codeInteger?

Returns the value of attribute status_code.

Returns:

  • (Integer, nil)


193
194
195
# File 'sig/types.rbs', line 193

def status_code
  @status_code
end

Class Method Details

.defaultResponse

Returns:



199
# File 'sig/types.rbs', line 199

def self.default: () -> Response

Instance Method Details

This method returns an undefined value.

Parameters:

  • key (String)
  • value (String)
  • secure (Boolean)
  • http_only (Boolean)
  • max_age (Integer)
  • domain (String)
  • path (String)
  • same_site (String)


198
# File 'sig/types.rbs', line 198

def set_cookie: (String key, String value, bool secure, bool http_only, ?Integer max_age, ?String domain, ?String path, ?String same_site) -> void

#set_headervoid

This method returns an undefined value.

Parameters:

  • key (String)
  • value (String)


197
# File 'sig/types.rbs', line 197

def set_header: (String key, String value) -> void