Class: Rack::Response::Raw

Inherits:
Object show all
Includes:
Helpers
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb

Direct Known Subclasses

Events::BufferedResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#accepted?, #add_header, #bad_request?, #cache!, #cache_control, #cache_control=, #client_error?, #content_length, #content_type, #content_type=, #created?, #delete_cookie, #do_not_cache!, #etag, #etag=, #forbidden?, #include?, #informational?, #invalid?, #location, #location=, #media_type, #media_type_params, #method_not_allowed?, #moved_permanently?, #no_content?, #not_found?, #ok?, #precondition_failed?, #redirect?, #redirection?, #server_error?, #set_cookie, #set_cookie_header, #set_cookie_header=, #successful?, #unauthorized?, #unprocessable?

Constructor Details

#initialize(status, headers) ⇒ Raw

Returns a new instance of Raw.



307
308
309
310
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 307

def initialize(status, headers)
  @status = status
  @headers = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



304
305
306
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 304

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



305
306
307
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 305

def status
  @status
end

Instance Method Details

#delete_header(key) ⇒ Object



315
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 315

def delete_header(key); headers.delete key; end

#get_header(key) ⇒ Object



313
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 313

def get_header(key);    headers[key];       end

#has_header?(key) ⇒ Boolean

Returns:

  • (Boolean)


312
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 312

def has_header?(key);   headers.key? key;   end

#set_header(key, v) ⇒ Object



314
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/response.rb', line 314

def set_header(key, v); headers[key] = v;   end