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])


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

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)


176
177
178
# File 'sig/types.rbs', line 176

def content
  @content
end

#headersHash[String, String]?

Returns the value of attribute headers.

Returns:

  • (Hash[String, String], nil)


178
179
180
# File 'sig/types.rbs', line 178

def headers
  @headers
end

#status_codeInteger?

Returns the value of attribute status_code.

Returns:

  • (Integer, nil)


177
178
179
# File 'sig/types.rbs', line 177

def status_code
  @status_code
end

Class Method Details

.defaultResponse

Returns:



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

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)


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

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)


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

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