Ruby on Rails 5.2 - ActionDispatch::TestRequest

वर्ग ActionDispatch :: TestRequest




ruby

वर्ग ActionDispatch :: TestRequest

जनक:
ActionDispatch::Request

स्थिरांक

DEFAULT_ENV

पब्लिक क्लास के तरीके

# File actionpack/lib/action_dispatch/testing/test_request.rb, line 15
def self.create(env = {})
  env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
  env["rack.request.cookie_hash"] ||= {}.with_indifferent_access
  new(default_env.merge(env))
end

डिफ़ॉल्ट env मानों के साथ एक नया परीक्षण अनुरोध बनाएँ।

सार्वजनिक प्रवृत्ति के तरीके

# File actionpack/lib/action_dispatch/testing/test_request.rb, line 66
def accept=(mime_types)
  delete_header("action_dispatch.request.accepts")
  set_header("HTTP_ACCEPT", Array(mime_types).collect(&:to_s).join(","))
end
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 46
def action=(action_name)
  path_parameters[:action] = action_name.to_s
end
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 30
def host=(host)
  set_header("HTTP_HOST", host)
end
if_modified_since = (last_modified) स्रोत दिखाएं
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 50
def if_modified_since=(last_modified)
  set_header("HTTP_IF_MODIFIED_SINCE", last_modified)
end
if_none_match = ( etag ) स्रोत दिखाएं
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 54
def if_none_match=(etag)
  set_header("HTTP_IF_NONE_MATCH", etag)
end
path = (पाथ) शो सोर्स
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 42
def path=(path)
  set_header("PATH_INFO", path)
end
port = (संख्या) स्रोत दिखाएँ
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 34
def port=(number)
  set_header("SERVER_PORT", number.to_i)
end
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 58
def remote_addr=(addr)
  set_header("REMOTE_ADDR", addr)
end
request_method = (विधि) स्रोत दिखाएं
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 26
def request_method=(method)
  super(method.to_s.upcase)
end
सुपरक्लास विधि कहता है
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 38
def request_uri=(uri)
  set_header("REQUEST_URI", uri)
end
user_agent = (user_agent) स्रोत दिखाएं
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 62
def user_agent=(user_agent)
  set_header("HTTP_USER_AGENT", user_agent)
end