# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `actionpack` gem. # Please instead update this file by running `bin/tapioca gem actionpack`. # source://actionpack//lib/abstract_controller.rb#8 module AbstractController extend ::ActiveSupport::Autoload class << self # source://actionpack//lib/abstract_controller.rb#24 def eager_load!; end end end # Raised when a non-existing controller action is triggered. # # source://actionpack//lib/abstract_controller/base.rb#11 class AbstractController::ActionNotFound < ::StandardError include ::DidYouMean::Correctable # @return [ActionNotFound] a new instance of ActionNotFound # # source://actionpack//lib/abstract_controller/base.rb#14 def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/base.rb#12 def action; end # source://actionpack//lib/abstract_controller/base.rb#12 def controller; end # source://actionpack//lib/abstract_controller/base.rb#23 def corrections; end end # source://actionpack//lib/abstract_controller/asset_paths.rb#4 module AbstractController::AssetPaths extend ::ActiveSupport::Concern end # AbstractController::Base is a low-level API. Nobody should be # using it directly, and subclasses (like ActionController::Base) are # expected to provide their own +render+ method, since rendering means # different things depending on the context. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/abstract_controller/base.rb#33 class AbstractController::Base include ::ActiveSupport::Configurable extend ::ActiveSupport::Configurable::ClassMethods extend ::ActiveSupport::DescendantsTracker # Delegates to the class's ::action_methods. # # source://actionpack//lib/abstract_controller/base.rb#161 def action_methods; end # Returns the name of the action this controller is processing. # # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def action_name; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def action_name=(_arg0); end # Returns true if a method for the action is available and # can be dispatched, false otherwise. # # Notice that action_methods.include?("foo") may return # false and available_action?("foo") returns true because # this method considers actions that are also available # through other means, for example, implicit render ones. # # ==== Parameters # * action_name - The name of an action to be tested # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#175 def available_action?(action_name); end # Delegates to the class's ::controller_path. # # source://actionpack//lib/abstract_controller/base.rb#156 def controller_path; end # Returns the formats that can be processed by the controller. # # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def formats; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def formats=(_arg0); end # source://actionpack//lib/abstract_controller/base.rb#194 def inspect; end # Tests if a response body is set. Used to determine if the # +process_action+ callback needs to be terminated in # AbstractController::Callbacks. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#182 def performed?; end # Calls the action going through the entire action dispatch stack. # # The actual method that is called is determined by calling # #method_for_action. If no method can handle the action, then an # AbstractController::ActionNotFound error is raised. # # ==== Returns # * self # # source://actionpack//lib/abstract_controller/base.rb#142 def process(action, *args, **_arg2); end # Returns the body of the HTTP response sent by the controller. # # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def response_body; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def response_body=(_arg0); end # Actually call the method associated with the action. Override # this method if you wish to change how action methods are called, # not to add additional behavior around it. For example, you would # override #send_action if you want to inject arguments into the # method. def send_action(*_arg0); end private # Takes an action name and returns the name of the method that will # handle the action. # # It checks if the action name is valid and returns false otherwise. # # See method_for_action for more information. # # ==== Parameters # * action_name - An action name to find a method name for # # ==== Returns # * string - The name of the method that handles the action # * false - No valid method name could be found. # Raise +AbstractController::ActionNotFound+. # # source://actionpack//lib/abstract_controller/base.rb#246 def _find_action_name(action_name); end # If the action name was not found, but a method called "action_missing" # was found, #method_for_action will return "_handle_action_missing". # This method calls #action_missing with the current action name. # # source://actionpack//lib/abstract_controller/base.rb#228 def _handle_action_missing(*args); end # Checks if the action name is valid and returns false otherwise. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#282 def _valid_action_name?(action_name); end # Returns true if the name can be considered an action because # it has a method defined in the controller. # # ==== Parameters # * name - The name of an action to be tested # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#204 def action_method?(name); end # Takes an action name and returns the name of the method that will # handle the action. In normal cases, this method returns the same # name as it receives. By default, if #method_for_action receives # a name that is not an action, it will look for an #action_missing # method and return "_handle_action_missing" if one is found. # # Subclasses may override this method to add additional conditions # that should be considered an action. For instance, an HTTP controller # with a template matching the action name is considered to exist. # # If you override this method to handle additional cases, you may # also provide a method (like +_handle_method_missing+) to handle # the case. # # If none of these conditions are true, and +method_for_action+ # returns +nil+, an +AbstractController::ActionNotFound+ exception will be raised. # # ==== Parameters # * action_name - An action name to find a method name for # # ==== Returns # * string - The name of the method that handles the action # * nil - No method name could be found. # # source://actionpack//lib/abstract_controller/base.rb#273 def method_for_action(action_name); end # Call the action. Override this in a subclass to modify the # behavior around processing an action. This, and not #process, # is the intended way to override action dispatching. # # Notice that the first argument is the method to be dispatched # which is *not* necessarily the same as the action name. # # source://actionpack//lib/abstract_controller/base.rb#214 def process_action(*_arg0, **_arg1, &_arg2); end class << self # Returns the value of attribute abstract. # # source://actionpack//lib/abstract_controller/base.rb#50 def abstract; end # Define a controller as abstract. See internal_methods for more # details. # # source://actionpack//lib/abstract_controller/base.rb#55 def abstract!; end # Returns the value of attribute abstract. # # source://actionpack//lib/abstract_controller/base.rb#50 def abstract?; end # A list of method names that should be considered actions. This # includes all public instance methods on a controller, less # any internal methods (see internal_methods), adding back in # any methods that are internal, but still exist on the class # itself. # # ==== Returns # * Set - A set of all methods that should be considered actions. # # source://actionpack//lib/abstract_controller/base.rb#89 def action_methods; end # action_methods are cached and there is sometimes a need to refresh # them. ::clear_action_methods! allows you to do that, so next time # you run action_methods, they will be recalculated. # # source://actionpack//lib/abstract_controller/base.rb#107 def clear_action_methods!; end # Returns the full controller name, underscored, without the ending Controller. # # class MyApp::MyPostsController < AbstractController::Base # # end # # MyApp::MyPostsController.controller_path # => "my_app/my_posts" # # ==== Returns # * String # # source://actionpack//lib/abstract_controller/base.rb#121 def controller_path; end # source://actionpack//lib/abstract_controller/base.rb#59 def inherited(klass); end # A list of all internal methods for a controller. This finds the first # abstract superclass of a controller, and gets a list of all public # instance methods on that abstract class. Public instance methods of # a controller would normally be considered action methods, so methods # declared on abstract classes are being removed. # (ActionController::Metal and ActionController::Base are defined as abstract) # # source://actionpack//lib/abstract_controller/base.rb#74 def internal_methods; end # Refresh the cached action_methods when a new action_method is added. # # source://actionpack//lib/abstract_controller/base.rb#126 def method_added(name); end # Returns true if the given controller is capable of rendering # a path. A subclass of +AbstractController::Base+ # may return false. An Email controller for example does not # support paths, only full URLs. # # @return [Boolean] # # source://actionpack//lib/abstract_controller/base.rb#190 def supports_path?; end end end # source://actionpack//lib/abstract_controller/caching.rb#4 module AbstractController::Caching include ::AbstractController::Caching::ConfigMethods extend ::ActiveSupport::Concern extend ::ActiveSupport::Autoload include GeneratedInstanceMethods include ::AbstractController::Caching::Fragments mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ConfigMethods # source://actionpack//lib/abstract_controller/caching.rb#52 def view_cache_dependencies; end private # Convenience accessor. # # source://actionpack//lib/abstract_controller/caching.rb#58 def cache(key, options = T.unsafe(nil), &block); end module GeneratedClassMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/abstract_controller/caching.rb#46 module AbstractController::Caching::ClassMethods # source://actionpack//lib/abstract_controller/caching.rb#47 def view_cache_dependency(&dependency); end end # source://actionpack//lib/abstract_controller/caching.rb#12 module AbstractController::Caching::ConfigMethods # source://actionpack//lib/abstract_controller/caching.rb#13 def cache_store; end # source://actionpack//lib/abstract_controller/caching.rb#17 def cache_store=(store); end private # @return [Boolean] # # source://actionpack//lib/abstract_controller/caching.rb#22 def cache_configured?; end end # Fragment caching is used for caching various blocks within # views without caching the entire action as a whole. This is # useful when certain elements of an action change frequently or # depend on complicated state while other parts rarely change or # can be shared amongst multiple parties. The caching is done using # the +cache+ helper available in the Action View. See # ActionView::Helpers::CacheHelper for more information. # # While it's strongly recommended that you use key-based cache # expiration (see links in CacheHelper for more information), # it is also possible to manually expire caches. For example: # # expire_fragment('name_of_cache') # # source://actionpack//lib/abstract_controller/caching/fragments.rb#18 module AbstractController::Caching::Fragments extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods # Given a key (as described in +expire_fragment+), returns # a key array suitable for use in reading, writing, or expiring a # cached fragment. All keys begin with :views, # followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, # followed by any controller-wide key prefix values, ending # with the specified +key+ value. # # source://actionpack//lib/abstract_controller/caching/fragments.rb#68 def combined_fragment_cache_key(key); end # Removes fragments from the cache. # # +key+ can take one of three forms: # # * String - This would normally take the form of a path, like # pages/45/notes. # * Hash - Treated as an implicit call to +url_for+, like # { controller: 'pages', action: 'notes', id: 45} # * Regexp - Will remove any fragment that matches, so # %r{pages/\d*/notes} might remove all notes. Make sure you # don't use anchors in the regex (^ or $) because # the actual filename matched looks like # ./cache/filename/path.cache. Note: Regexp expiration is # only supported on caches that can iterate over all keys (unlike # memcached). # # +options+ is passed through to the cache store's +delete+ # method (or delete_matched, for Regexp keys). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#132 def expire_fragment(key, options = T.unsafe(nil)); end # Check if a cached fragment from the location signified by # +key+ exists (see +expire_fragment+ for acceptable formats). # # @return [Boolean] # # source://actionpack//lib/abstract_controller/caching/fragments.rb#105 def fragment_exist?(key, options = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#145 def instrument_fragment_cache(name, key, &block); end # Reads a cached fragment from the location signified by +key+ # (see +expire_fragment+ for acceptable formats). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#93 def read_fragment(key, options = T.unsafe(nil)); end # Writes +content+ to the location signified by # +key+ (see +expire_fragment+ for acceptable formats). # # source://actionpack//lib/abstract_controller/caching/fragments.rb#80 def write_fragment(key, content, options = T.unsafe(nil)); end module GeneratedClassMethods def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/abstract_controller/caching/fragments.rb#35 module AbstractController::Caching::Fragments::ClassMethods # Allows you to specify controller-wide key prefixes for # cache fragments. Pass either a constant +value+, or a block # which computes a value each time a cache key is generated. # # For example, you may want to prefix all fragment cache keys # with a global version identifier, so you can easily # invalidate all caches. # # class ApplicationController # fragment_cache_key "v1" # end # # When it's time to invalidate all fragments, simply change # the string constant. Or, progressively roll out the cache # invalidation using a computed value: # # class ApplicationController # fragment_cache_key do # @account.id.odd? ? "v1" : "v2" # end # end # # source://actionpack//lib/abstract_controller/caching/fragments.rb#57 def fragment_cache_key(value = T.unsafe(nil), &key); end end # = Abstract Controller Callbacks # # Abstract Controller provides hooks during the life cycle of a controller action. # Callbacks allow you to trigger logic during this cycle. Available callbacks are: # # * after_action # * append_after_action # * append_around_action # * append_before_action # * around_action # * before_action # * prepend_after_action # * prepend_around_action # * prepend_before_action # * skip_after_action # * skip_around_action # * skip_before_action # # NOTE: Calling the same callback multiple times will overwrite previous callback definitions. # # source://actionpack//lib/abstract_controller/callbacks.rb#24 module AbstractController::Callbacks extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActiveSupport::Callbacks mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods mixes_in_class_methods ::ActiveSupport::DescendantsTracker mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods private # Override AbstractController::Base#process_action to run the # process_action callbacks around the normal behavior. # # source://actionpack//lib/abstract_controller/callbacks.rb#232 def process_action(*_arg0, **_arg1, &_arg2); end module GeneratedClassMethods def __callbacks; end def __callbacks=(value); end def __callbacks?; end end module GeneratedInstanceMethods def __callbacks; end def __callbacks?; end end end # source://actionpack//lib/abstract_controller/callbacks.rb#38 class AbstractController::Callbacks::ActionFilter # @return [ActionFilter] a new instance of ActionFilter # # source://actionpack//lib/abstract_controller/callbacks.rb#39 def initialize(actions); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#43 def after(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#43 def around(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#43 def before(controller); end # @return [Boolean] # # source://actionpack//lib/abstract_controller/callbacks.rb#43 def match?(controller); end end # source://actionpack//lib/abstract_controller/callbacks.rb#52 module AbstractController::Callbacks::ClassMethods # Take callback names and an optional callback proc, normalize them, # then call the block with each callback. This allows us to abstract # the normalization across several methods that use it. # # ==== Parameters # * callbacks - An array of callbacks, with an optional # options hash as the last parameter. # * block - A proc that should be added to the callbacks. # # ==== Block Parameters # * name - The callback to be added. # * options - A hash of options to be used when adding the callback. # # source://actionpack//lib/abstract_controller/callbacks.rb#96 def _insert_callbacks(callbacks, block = T.unsafe(nil)); end # source://actionpack//lib/abstract_controller/callbacks.rb#77 def _normalize_callback_option(options, from, to); end # If +:only+ or +:except+ are used, convert the options into the # +:if+ and +:unless+ options of ActiveSupport::Callbacks. # # The basic idea is that :only => :index gets converted to # :if => proc {|c| c.action_name == "index" }. # # Note that :only has priority over :if in case they # are used together. # # only: :index, if: -> { true } # the :if option will be ignored. # # Note that :if has priority over :except in case they # are used together. # # except: :index, if: -> { true } # the :except option will be ignored. # # ==== Options # * only - The callback should be run only for this action. # * except - The callback should be run for all actions except this action. # # source://actionpack//lib/abstract_controller/callbacks.rb#72 def _normalize_callback_options(options); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def append_after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def append_around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def append_before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#204 def before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#210 def prepend_after_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#210 def prepend_around_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#210 def prepend_before_action(*names, &blk); end # source://actionpack//lib/abstract_controller/callbacks.rb#218 def skip_after_action(*names); end # source://actionpack//lib/abstract_controller/callbacks.rb#218 def skip_around_action(*names); end # source://actionpack//lib/abstract_controller/callbacks.rb#218 def skip_before_action(*names); end end # source://actionpack//lib/abstract_controller/collector.rb#6 module AbstractController::Collector # source://actionpack//lib/abstract_controller/collector.rb#10 def atom(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def bmp(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def css(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def csv(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def gif(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def gzip(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def html(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def ics(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def jpeg(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def js(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def json(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def m4a(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def mp3(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def mp4(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def mpeg(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def multipart_form(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def ogg(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def otf(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def pdf(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def png(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def rss(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def svg(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def text(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def tiff(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def ttf(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def url_encoded_form(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def vcf(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def vtt(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def webm(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def woff(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def woff2(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def xml(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def yaml(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/collector.rb#10 def zip(*args, **_arg1, &block); end private # source://actionpack//lib/abstract_controller/collector.rb#26 def method_missing(symbol, *args, **_arg2, &block); end class << self # source://actionpack//lib/abstract_controller/collector.rb#7 def generate_method_for_mime(mime); end end end # source://actionpack//lib/abstract_controller/rendering.rb#9 class AbstractController::DoubleRenderError < ::AbstractController::Error # @return [DoubleRenderError] a new instance of DoubleRenderError # # source://actionpack//lib/abstract_controller/rendering.rb#12 def initialize(message = T.unsafe(nil)); end end # source://actionpack//lib/abstract_controller/rendering.rb#10 AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) # source://actionpack//lib/abstract_controller/error.rb#4 class AbstractController::Error < ::StandardError; end # source://actionpack//lib/abstract_controller/helpers.rb#7 module AbstractController::Helpers extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods # source://actionpack//lib/abstract_controller/helpers.rb#40 def _helpers; end module GeneratedClassMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end module GeneratedInstanceMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end end # source://actionpack//lib/abstract_controller/helpers.rb#44 module AbstractController::Helpers::ClassMethods # Sets the attribute _helpers # # @param value the value to set the attribute _helpers to. # # source://actionpack//lib/abstract_controller/helpers.rb#56 def _helpers=(_arg0); end # source://actionpack//lib/abstract_controller/helpers.rb#184 def _helpers_for_modification; end # Clears up all existing helpers in this class, only keeping the helper # with the same name as this class. # # source://actionpack//lib/abstract_controller/helpers.rb#158 def clear_helpers; end # Includes the given modules in the template class. # # Modules can be specified in different ways. All of the following calls # include +FooHelper+: # # # Module, recommended. # helper FooHelper # # # String/symbol without the "helper" suffix, camel or snake case. # helper "Foo" # helper :Foo # helper "foo" # helper :foo # # The last two assume that "foo".camelize returns "Foo". # # When strings or symbols are passed, the method finds the actual module # object using String#constantize. Therefore, if the module has not been # yet loaded, it has to be autoloadable, which is normally the case. # # Namespaces are supported. The following calls include +Foo::BarHelper+: # # # Module, recommended. # helper Foo::BarHelper # # # String/symbol without the "helper" suffix, camel or snake case. # helper "Foo::Bar" # helper :"Foo::Bar" # helper "foo/bar" # helper :"foo/bar" # # The last two assume that "foo/bar".camelize returns "Foo::Bar". # # The method accepts a block too. If present, the block is evaluated in # the context of the controller helper module. This simple call makes the # +wadus+ method available in templates of the enclosing controller: # # helper do # def wadus # "wadus" # end # end # # Furthermore, all the above styles can be mixed together: # # helper FooHelper, "woo", "bar/baz" do # def wadus # "wadus" # end # end # # source://actionpack//lib/abstract_controller/helpers.rb#147 def helper(*args, &block); end # Declare a controller method as a helper. For example, the following # makes the +current_user+ and +logged_in?+ controller methods available # to the view: # class ApplicationController < ActionController::Base # helper_method :current_user, :logged_in? # # def current_user # @current_user ||= User.find_by(id: session[:user]) # end # # def logged_in? # current_user != nil # end # end # # In a view: # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> # # ==== Parameters # * method[, method] - A name or names of a method on the controller # to be made available on the view. # # source://actionpack//lib/abstract_controller/helpers.rb#79 def helper_method(*methods); end # When a class is inherited, wrap its helper module in a new module. # This ensures that the parent class's module can be changed # independently of the child class's. # # source://actionpack//lib/abstract_controller/helpers.rb#48 def inherited(klass); end # Given an array of values like the ones accepted by +helper+, this method # returns an array with the corresponding modules, in the same order. # # source://actionpack//lib/abstract_controller/helpers.rb#169 def modules_for_helpers(modules_or_helper_prefixes); end private # source://actionpack//lib/abstract_controller/helpers.rb#203 def default_helper_module!; end # source://actionpack//lib/abstract_controller/helpers.rb#192 def define_helpers_module(klass, helpers = T.unsafe(nil)); end end # source://actionpack//lib/abstract_controller/helpers.rb#26 class AbstractController::Helpers::MissingHelperError < ::LoadError # @return [MissingHelperError] a new instance of MissingHelperError # # source://actionpack//lib/abstract_controller/helpers.rb#27 def initialize(error, path); end end # source://actionpack//lib/abstract_controller/logger.rb#6 module AbstractController::Logger extend ::ActiveSupport::Concern include ::ActiveSupport::Benchmarkable end # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#6 module AbstractController::Railties; end # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#7 module AbstractController::Railties::RoutesHelpers class << self # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#8 def with(routes, include_path_helpers = T.unsafe(nil)); end end end # source://actionpack//lib/abstract_controller/rendering.rb#17 module AbstractController::Rendering extend ::ActiveSupport::Concern include ::ActionView::ViewPaths mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods # Normalizes arguments, options and then delegates render_to_body and # sticks the result in self.response_body. # # source://actionpack//lib/abstract_controller/rendering.rb#23 def render(*args, &block); end # Performs the actual template rendering. # # source://actionpack//lib/abstract_controller/rendering.rb#51 def render_to_body(options = T.unsafe(nil)); end # Raw rendering of a template to a string. # # It is similar to render, except that it does not # set the +response_body+ and it should be guaranteed # to always return a string. # # If a component extends the semantics of +response_body+ # (as ActionController extends it to be anything that # responds to the method each), this method needs to be # overridden in order to still return a string. # # source://actionpack//lib/abstract_controller/rendering.rb#45 def render_to_string(*args, &block); end # Returns Content-Type of rendered content. # # source://actionpack//lib/abstract_controller/rendering.rb#55 def rendered_format; end # This method should return a hash with assigns. # You can overwrite this configuration per controller. # # source://actionpack//lib/abstract_controller/rendering.rb#63 def view_assigns; end private # Normalize args by converting render "foo" to # render :action => "foo" and render "foo/bar" to # render :file => "foo/bar". # # source://actionpack//lib/abstract_controller/rendering.rb#75 def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end # Normalize options. # # source://actionpack//lib/abstract_controller/rendering.rb#90 def _normalize_options(options); end # Normalize args and options. # # source://actionpack//lib/abstract_controller/rendering.rb#116 def _normalize_render(*args, &block); end # Process the rendered format. # # source://actionpack//lib/abstract_controller/rendering.rb#100 def _process_format(format); end # Process extra options. # # source://actionpack//lib/abstract_controller/rendering.rb#95 def _process_options(options); end # source://actionpack//lib/abstract_controller/rendering.rb#103 def _process_variant(options); end # source://actionpack//lib/abstract_controller/rendering.rb#123 def _protected_ivars; end # source://actionpack//lib/abstract_controller/rendering.rb#106 def _set_html_content_type; end # source://actionpack//lib/abstract_controller/rendering.rb#112 def _set_rendered_content_type(format); end # source://actionpack//lib/abstract_controller/rendering.rb#109 def _set_vary_header; end end # source://actionpack//lib/abstract_controller/rendering.rb#59 AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/abstract_controller/translation.rb#6 module AbstractController::Translation # Delegates to I18n.localize. Also aliased as l. # # source://actionpack//lib/abstract_controller/translation.rb#33 def l(object, **options); end # Delegates to I18n.localize. Also aliased as l. # # source://actionpack//lib/abstract_controller/translation.rb#33 def localize(object, **options); end # source://actionpack//lib/abstract_controller/translation.rb#7 def raise_on_missing_translations; end # source://actionpack//lib/abstract_controller/translation.rb#7 def raise_on_missing_translations=(val); end # Delegates to I18n.translate. Also aliased as t. # # When the given key starts with a period, it will be scoped by the current # controller and action. So if you call translate(".foo") from # PeopleController#index, it will convert the call to # I18n.translate("people.index.foo"). This makes it less repetitive # to translate many keys within the same controller / action and gives you a # simple framework for scoping them consistently. # # source://actionpack//lib/abstract_controller/translation.rb#17 def t(key, **options); end # Delegates to I18n.translate. Also aliased as t. # # When the given key starts with a period, it will be scoped by the current # controller and action. So if you call translate(".foo") from # PeopleController#index, it will convert the call to # I18n.translate("people.index.foo"). This makes it less repetitive # to translate many keys within the same controller / action and gives you a # simple framework for scoping them consistently. # # source://actionpack//lib/abstract_controller/translation.rb#17 def translate(key, **options); end class << self # source://actionpack//lib/abstract_controller/translation.rb#7 def raise_on_missing_translations; end # source://actionpack//lib/abstract_controller/translation.rb#7 def raise_on_missing_translations=(val); end end end # Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class # has to provide a +RouteSet+ by implementing the _routes methods. Otherwise, an # exception will be raised. # # Note that this module is completely decoupled from HTTP - the only requirement is a valid # _routes implementation. # # source://actionpack//lib/abstract_controller/url_for.rb#10 module AbstractController::UrlFor extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionDispatch::Routing::UrlFor mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods # source://actionpack//lib/abstract_controller/url_for.rb#14 def _routes; end module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # source://actionpack//lib/abstract_controller/url_for.rb#19 module AbstractController::UrlFor::ClassMethods # source://actionpack//lib/abstract_controller/url_for.rb#20 def _routes; end # source://actionpack//lib/abstract_controller/url_for.rb#24 def action_methods; end end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#13 module ActionController extend ::ActiveSupport::Autoload class << self # See Renderers.add # # source://actionpack//lib/action_controller/metal/renderers.rb#7 def add_renderer(key, &block); end # See Renderers.remove # # source://actionpack//lib/action_controller/metal/renderers.rb#12 def remove_renderer(key); end end end # API Controller is a lightweight version of ActionController::Base, # created for applications that don't require all functionalities that a complete # \Rails controller provides, allowing you to create controllers with just the # features that you need for API only applications. # # An API Controller is different from a normal controller in the sense that # by default it doesn't include a number of features that are usually required # by browser access only: layouts and templates rendering, # flash, assets, and so on. This makes the entire controller stack thinner, # suitable for API applications. It doesn't mean you won't have such # features if you need them: they're all available for you to include in # your application, they're just not part of the default API controller stack. # # Normally, +ApplicationController+ is the only controller that inherits from # ActionController::API. All other controllers in turn inherit from # +ApplicationController+. # # A sample controller could look like this: # # class PostsController < ApplicationController # def index # posts = Post.all # render json: posts # end # end # # Request, response, and parameters objects all work the exact same way as # ActionController::Base. # # == Renders # # The default API Controller stack includes all renderers, which means you # can use render :json and siblings freely in your controllers. Keep # in mind that templates are not going to be rendered, so you need to ensure # your controller is calling either render or redirect_to in # all actions, otherwise it will return 204 No Content. # # def show # post = Post.find(params[:id]) # render json: post # end # # == Redirects # # Redirects are used to move from one action to another. You can use the # redirect_to method in your controllers in the same way as in # ActionController::Base. For example: # # def create # redirect_to root_url and return if not_authorized? # # do stuff here # end # # == Adding New Behavior # # In some scenarios you may want to add back some functionality provided by # ActionController::Base that is not present by default in # ActionController::API, for instance MimeResponds. This # module gives you the respond_to method. Adding it is quite simple, # you just need to include the module in a specific controller or in # +ApplicationController+ in case you want it available in your entire # application: # # class ApplicationController < ActionController::API # include ActionController::MimeResponds # end # # class PostsController < ApplicationController # def index # posts = Post.all # # respond_to do |format| # format.json { render json: posts } # format.xml { render xml: posts } # end # end # end # # Make sure to check the modules included in ActionController::Base # if you want to use any other functionality that is not provided # by ActionController::API out of the box. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/api.rb#89 class ActionController::API < ::ActionController::Metal include ::ActionView::ViewPaths include ::AbstractController::Rendering include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor include ::ActionController::UrlFor include ::AbstractController::Logger include ::ActiveSupport::Benchmarkable include ::ActionController::Redirecting include ::ActionController::ApiRendering include ::ActionController::Rendering include ::ActionController::Renderers include ::ActionController::Renderers::All include ::ActionController::Head include ::ActionController::ConditionalGet include ::ActionController::BasicImplicitRender include ::ActionController::StrongParameters include ::ActionController::DataStreaming include ::ActionController::DefaultHeaders include ::ActionController::Logging include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks include ::ActiveSupport::Rescuable include ::ActionController::Rescue include ::ActionController::Instrumentation include ::ActionController::ParamsWrapper extend ::ActionView::ViewPaths::ClassMethods extend ::AbstractController::UrlFor::ClassMethods extend ::ActionController::Rendering::ClassMethods extend ::ActionController::Renderers::ClassMethods extend ::ActionController::ConditionalGet::ClassMethods extend ::ActionController::DefaultHeaders::ClassMethods extend ::ActionController::Logging::ClassMethods extend ::ActiveSupport::Callbacks::ClassMethods extend ::AbstractController::Callbacks::ClassMethods extend ::ActiveSupport::Rescuable::ClassMethods extend ::ActionController::Instrumentation::ClassMethods extend ::ActionController::ParamsWrapper::ClassMethods # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#940 def _process_action_callbacks; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(_arg0); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#928 def _run_process_action_callbacks(&block); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(_arg0); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers=(_arg0); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def logger; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def logger=(value); end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects=(val); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers; end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers=(_arg0); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers?; end class << self # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks=(value); end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#932 def _process_action_callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#936 def _process_action_callbacks=(value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(value); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers=(value); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def logger; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def logger=(value); end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack; end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects=(val); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers; end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers=(value); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers?; end # Shortcut helper that returns all the ActionController::API modules except # the ones passed as arguments: # # class MyAPIBaseController < ActionController::Metal # ActionController::API.without_modules(:UrlFor).each do |left| # include left # end # end # # This gives better control over what you want to exclude and makes it easier # to create an API controller class, instead of listing the modules required # manually. # # source://actionpack//lib/action_controller/api.rb#104 def without_modules(*modules); end end end # source://actionpack//lib/action_controller/api.rb#112 ActionController::API::MODULES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/exceptions.rb#4 class ActionController::ActionControllerError < ::StandardError; end # source://actionpack//lib/action_controller/api/api_rendering.rb#4 module ActionController::ApiRendering extend ::ActiveSupport::Concern include ::ActionController::Rendering mixes_in_class_methods ::ActionController::Rendering::ClassMethods # source://actionpack//lib/action_controller/api/api_rendering.rb#11 def render_to_body(options = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/exceptions.rb#7 class ActionController::BadRequest < ::ActionController::ActionControllerError # @return [BadRequest] a new instance of BadRequest # # source://actionpack//lib/action_controller/metal/exceptions.rb#8 def initialize(msg = T.unsafe(nil)); end end # Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed # on request and then either it renders a template or redirects to another action. An action is defined as a public method # on the controller, which will automatically be made accessible to the web-server through \Rails Routes. # # By default, only the ApplicationController in a \Rails application inherits from ActionController::Base. All other # controllers inherit from ApplicationController. This gives you one class to configure things such as # request forgery protection and filtering of sensitive request parameters. # # A sample controller could look like this: # # class PostsController < ApplicationController # def index # @posts = Post.all # end # # def create # @post = Post.create params[:post] # redirect_to posts_path # end # end # # Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action # after executing code in the action. For example, the +index+ action of the PostsController would render the # template app/views/posts/index.html.erb by default after populating the @posts instance variable. # # Unlike index, the create action will not render a template. After performing its main purpose (creating a # new post), it initiates a redirect instead. This redirect works by returning an external # 302 Moved HTTP response that takes the user to the index action. # # These two methods represent the two basic action archetypes used in Action Controllers: Get-and-show and do-and-redirect. # Most actions are variations on these themes. # # == Requests # # For every request, the router determines the value of the +controller+ and +action+ keys. These determine which controller # and action are called. The remaining request parameters, the session (if one is available), and the full request with # all the HTTP headers are made available to the action through accessor methods. Then the action is performed. # # The full request object is available via the request accessor and is primarily used to query for HTTP headers: # # def server_ip # location = request.env["REMOTE_ADDR"] # render plain: "This server hosted at #{location}" # end # # == Parameters # # All request parameters, whether they come from a query string in the URL or form data submitted through a POST request are # available through the params method which returns a hash. For example, an action that was performed through # /posts?category=All&limit=5 will include { "category" => "All", "limit" => "5" } in params. # # It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as: # # # # # A request coming from a form holding these inputs will include { "post" => { "name" => "david", "address" => "hyacintvej" } }. # If the address input had been named post[address][street], the params would have included # { "post" => { "address" => { "street" => "hyacintvej" } } }. There's no limit to the depth of the nesting. # # == Sessions # # Sessions allow you to store objects in between requests. This is useful for objects that are not yet ready to be persisted, # such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such # as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely # they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at. # # You can place objects in the session by using the session method, which accesses a hash: # # session[:person] = Person.authenticate(user_name, password) # # You can retrieve it again through the same hash: # # "Hello #{session[:person]}" # # For removing objects from the session, you can either assign a single key to +nil+: # # # removes :person from session # session[:person] = nil # # or you can remove the entire session with +reset_session+. # # By default, sessions are stored in an encrypted browser cookie (see # ActionDispatch::Session::CookieStore). Thus the user will not be able to # read or edit the session data. However, the user can keep a copy of the # cookie even after it has expired, so you should avoid storing sensitive # information in cookie-based sessions. # # == Responses # # Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response # object is generated automatically through the use of renders and redirects and requires no user intervention. # # == Renders # # Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering # of a template. Included in the Action Pack is the Action View, which enables rendering of ERB templates. It's automatically configured. # The controller passes objects to the view by assigning instance variables: # # def show # @post = Post.find(params[:id]) # end # # Which are then automatically available to the view: # # Title: <%= @post.title %> # # You don't have to rely on the automated rendering. For example, actions that could result in the rendering of different templates # will use the manual rendering methods: # # def search # @results = Search.find(params[:query]) # case @results.count # when 0 then render action: "no_results" # when 1 then render action: "show" # when 2..10 then render action: "show_many" # end # end # # Read more about writing ERB and Builder templates in ActionView::Base. # # == Redirects # # Redirects are used to move from one action to another. For example, after a create action, which stores a blog entry to the # database, we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself), we're # going to reuse (and redirect to) a show action that we'll assume has already been created. The code might look like this: # # def create # @entry = Entry.new(params[:entry]) # if @entry.save # # The entry was saved correctly, redirect to show # redirect_to action: 'show', id: @entry.id # else # # things didn't go so well, do something else # end # end # # In this case, after saving our new entry to the database, the user is redirected to the show method, which is then executed. # Note that this is an external HTTP-level redirection which will cause the browser to make a second request (a GET to the show action), # and not some internal re-routing which calls both "create" and then "show" within one request. # # Learn more about redirect_to and what options you have in ActionController::Redirecting. # # == Calling multiple redirects or renders # # An action may contain only a single render or a single redirect. Attempting to try to do either again will result in a DoubleRenderError: # # def do_something # redirect_to action: "elsewhere" # render action: "overthere" # raises DoubleRenderError # end # # If you need to redirect on the condition of something, then be sure to add "and return" to halt execution. # # def do_something # redirect_to(action: "elsewhere") and return if monkeys.nil? # render action: "overthere" # won't be called if monkeys is nil # end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/base.rb#167 class ActionController::Base < ::ActionController::Metal include ::ActionView::ViewPaths include ::AbstractController::Rendering include ::AbstractController::Translation include ::AbstractController::AssetPaths include ::AbstractController::Helpers include ::ActionController::Helpers include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor include ::ActionController::UrlFor include ::AbstractController::Logger include ::ActiveSupport::Benchmarkable include ::ActionController::Redirecting include ::ActionView::Rendering include ::ActionView::Layouts include ::ActionController::Rendering include ::ActionController::Renderers include ::ActionController::Renderers::All include ::ActionController::Head include ::ActionController::ConditionalGet include ::ActionController::EtagWithTemplateDigest include ::ActionController::EtagWithFlash include ::ActionController::Caching include ::AbstractController::Caching::Fragments include ::AbstractController::Caching::ConfigMethods include ::AbstractController::Caching include ::ActionController::MimeResponds include ::ActionController::BasicImplicitRender include ::ActionController::ImplicitRender include ::ActionController::StrongParameters include ::ActionController::ParameterEncoding include ::ActionController::Cookies include ::ActionController::Flash include ::ActionController::FormBuilder include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks include ::ActionController::RequestForgeryProtection include ::ActionController::ContentSecurityPolicy include ::ActionController::PermissionsPolicy include ::ActionController::Streaming include ::ActionController::DataStreaming include ::ActionController::HttpAuthentication::Basic::ControllerMethods include ::ActionController::HttpAuthentication::Digest::ControllerMethods include ::ActionController::HttpAuthentication::Token::ControllerMethods include ::ActionController::DefaultHeaders include ::ActionController::Logging include ::ActiveSupport::Rescuable include ::ActionController::Rescue include ::ActionController::Instrumentation include ::ActionController::ParamsWrapper extend ::ActionView::ViewPaths::ClassMethods extend ::AbstractController::Helpers::ClassMethods extend ::ActionController::Helpers::ClassMethods extend ::AbstractController::UrlFor::ClassMethods extend ::ActionView::Rendering::ClassMethods extend ::ActionView::Layouts::ClassMethods extend ::ActionController::Rendering::ClassMethods extend ::ActionController::Renderers::ClassMethods extend ::ActionController::ConditionalGet::ClassMethods extend ::AbstractController::Caching::Fragments::ClassMethods extend ::AbstractController::Caching::ClassMethods extend ::AbstractController::Caching::ConfigMethods extend ::ActionController::ParameterEncoding::ClassMethods extend ::ActionController::Flash::ClassMethods extend ::ActionController::FormBuilder::ClassMethods extend ::ActiveSupport::Callbacks::ClassMethods extend ::AbstractController::Callbacks::ClassMethods extend ::ActionController::RequestForgeryProtection::ClassMethods extend ::ActionController::ContentSecurityPolicy::ClassMethods extend ::ActionController::PermissionsPolicy::ClassMethods extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods extend ::ActionController::DefaultHeaders::ClassMethods extend ::ActionController::Logging::ClassMethods extend ::ActiveSupport::Rescuable::ClassMethods extend ::ActionController::Instrumentation::ClassMethods extend ::ActionController::ParamsWrapper::ClassMethods # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods; end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods=(_arg0); end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#940 def _process_action_callbacks; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(_arg0); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#928 def _run_process_action_callbacks(&block); end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies; end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies=(_arg0); end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies?; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(_arg0); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://actionpack//lib/action_controller/metal/flash.rb#36 def alert; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def allow_forgery_protection; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def allow_forgery_protection=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def asset_host; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def asset_host=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def assets_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def assets_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_asset_host_protocol; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_asset_host_protocol=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_protect_from_forgery; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_protect_from_forgery=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_static_extension; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_static_extension=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def enable_fragment_cache_logging; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def enable_fragment_cache_logging=(value); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest; end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest=(_arg0); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest?; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers=(_arg0); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers?; end # source://actionpack//lib/action_controller/metal/flash.rb#10 def flash(*_arg0, **_arg1, &_arg2); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def forgery_protection_origin_check; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def forgery_protection_origin_check=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def forgery_protection_strategy; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def forgery_protection_strategy=(value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys; end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys=(_arg0); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys?; end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path; end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path=(_arg0); end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path?; end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers; end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers=(_arg0); end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def javascripts_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def javascripts_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def log_warning_on_csrf_failure; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def log_warning_on_csrf_failure=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def logger; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def logger=(value); end # source://actionpack//lib/action_controller/metal/flash.rb#36 def notice; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def per_form_csrf_tokens; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def per_form_csrf_tokens=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def perform_caching; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def perform_caching=(value); end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects=(val); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def relative_url_root; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def relative_url_root=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def request_forgery_protection_token; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def request_forgery_protection_token=(value); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers; end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers=(_arg0); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def stylesheets_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def stylesheets_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def urlsafe_csrf_tokens; end private # source://actionview/7.0.4.3/lib/action_view/layouts.rb#328 def _layout(lookup_context, formats); end # source://actionpack//lib/action_controller/base.rb#266 def _protected_ivars; end class << self # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks=(value); end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://actionpack//lib/action_controller/form_builder.rb#31 def _default_form_builder; end # source://actionpack//lib/action_controller/form_builder.rb#31 def _default_form_builder=(value); end # source://actionpack//lib/action_controller/form_builder.rb#31 def _default_form_builder?; end # source://actionpack//lib/action_controller/metal/flash.rb#8 def _flash_types; end # source://actionpack//lib/action_controller/metal/flash.rb#8 def _flash_types=(value); end # source://actionpack//lib/action_controller/metal/flash.rb#8 def _flash_types?; end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods; end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods=(value); end # source://actionpack//lib/abstract_controller/helpers.rb#11 def _helper_methods?; end # source://actionpack//lib/abstract_controller/helpers.rb#15 def _helpers; end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#209 def _layout; end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#209 def _layout=(value); end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#209 def _layout?; end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 def _layout_conditions; end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 def _layout_conditions=(value); end # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 def _layout_conditions?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#932 def _process_action_callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#936 def _process_action_callbacks=(value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers; end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers=(value); end # source://actionpack//lib/action_controller/metal/renderers.rb#31 def _renderers?; end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies; end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies=(value); end # source://actionpack//lib/abstract_controller/caching.rb#42 def _view_cache_dependencies?; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options; end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options=(value); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 def _wrapper_options?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def allow_forgery_protection; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def allow_forgery_protection=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def asset_host; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def asset_host=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def assets_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def assets_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_asset_host_protocol; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_asset_host_protocol=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_protect_from_forgery; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_protect_from_forgery=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def default_static_extension; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def default_static_extension=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def enable_fragment_cache_logging; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def enable_fragment_cache_logging=(value); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest; end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest=(value); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 def etag_with_template_digest?; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers; end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers=(value); end # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 def etaggers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def forgery_protection_origin_check; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def forgery_protection_origin_check=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def forgery_protection_strategy; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def forgery_protection_strategy=(value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys; end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys=(value); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 def fragment_cache_keys?; end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path; end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path=(value); end # source://actionpack//lib/action_controller/metal/helpers.rb#63 def helpers_path?; end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers; end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers=(value); end # source://actionpack//lib/action_controller/metal/helpers.rb#64 def include_all_helpers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def javascripts_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def javascripts_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def log_warning_on_csrf_failure; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def log_warning_on_csrf_failure=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def logger; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def logger=(value); end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def per_form_csrf_tokens; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def per_form_csrf_tokens=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def perform_caching; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def perform_caching=(value); end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects; end # source://actionpack//lib/action_controller/metal/redirecting.rb#13 def raise_on_open_redirects=(val); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def relative_url_root; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def relative_url_root=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def request_forgery_protection_token; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def request_forgery_protection_token=(value); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers; end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers=(value); end # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 def rescue_handlers?; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def stylesheets_dir; end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 def stylesheets_dir=(value); end # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 def urlsafe_csrf_tokens; end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#97 def urlsafe_csrf_tokens=(urlsafe_csrf_tokens); end # Shortcut helper that returns all the modules included in # ActionController::Base except the ones passed as arguments: # # class MyBaseController < ActionController::Metal # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| # include left # end # end # # This gives better control over what you want to exclude and makes it # easier to create a bare controller class, instead of listing the modules # required manually. # # source://actionpack//lib/action_controller/base.rb#198 def without_modules(*modules); end end end # source://actionpack//lib/action_controller/base.rb#0 module ActionController::Base::HelperMethods # source://actionpack//lib/action_controller/metal/flash.rb#39 def alert(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/caching/fragments.rb#31 def combined_fragment_cache_key(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#11 def content_security_policy?(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#12 def content_security_policy_nonce(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/cookies.rb#8 def cookies(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#106 def form_authenticity_token(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/flash.rb#39 def notice(*args, **_arg1, &block); end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#107 def protect_against_forgery?(*args, **_arg1, &block); end # source://actionpack//lib/abstract_controller/caching.rb#43 def view_cache_dependencies(*args, **_arg1, &block); end end # source://actionpack//lib/action_controller/base.rb#206 ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) # Define some internal variables that should not be propagated to the view. # # source://actionpack//lib/action_controller/base.rb#261 ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#4 module ActionController::BasicImplicitRender # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#9 def default_render; end # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#5 def send_action(method, *args); end end # \Caching is a cheap way of speeding up slow applications by keeping the result of # calculations, renderings, and database calls around for subsequent requests. # # You can read more about each approach by clicking the modules below. # # Note: To turn off all caching provided by Action Controller, set # config.action_controller.perform_caching = false # # == \Caching stores # # All the caching stores from ActiveSupport::Cache are available to be used as backends # for Action Controller caching. # # Configuration examples (FileStore is the default): # # config.action_controller.cache_store = :memory_store # config.action_controller.cache_store = :file_store, '/path/to/cache/directory' # config.action_controller.cache_store = :mem_cache_store, 'localhost' # config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') # config.action_controller.cache_store = MyOwnStore.new('parameter') # # source://actionpack//lib/action_controller/caching.rb#24 module ActionController::Caching extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Caching::Fragments include ::AbstractController::Caching mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ClassMethods mixes_in_class_methods ::AbstractController::Caching::ConfigMethods private # source://actionpack//lib/action_controller/caching.rb#40 def instrument_name; end # source://actionpack//lib/action_controller/caching.rb#32 def instrument_payload(key); end module GeneratedClassMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end module GeneratedInstanceMethods def _view_cache_dependencies; end def _view_cache_dependencies=(value); end def _view_cache_dependencies?; end def fragment_cache_keys; end def fragment_cache_keys=(value); end def fragment_cache_keys?; end end end # source://actionpack//lib/action_controller/metal/conditional_get.rb#7 module ActionController::ConditionalGet include ::ActionController::Head extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods # Sets an HTTP 1.1 Cache-Control header. Defaults to issuing a +private+ # instruction, so that intermediate caches must not cache the response. # # expires_in 20.minutes # expires_in 3.hours, public: true # expires_in 3.hours, public: true, must_revalidate: true # # This method will overwrite an existing Cache-Control header. # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. # # HTTP Cache-Control Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861 # It helps to cache an asset and serve it while is being revalidated and/or returning with an error. # # expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds # expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes # # HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control # Any additional key-value pairs are concatenated onto the Cache-Control header in the response: # # expires_in 3.hours, public: true, "s-maxage": 3.hours, "no-transform": true # # The method will also ensure an HTTP Date header for client compatibility. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#276 def expires_in(seconds, options = T.unsafe(nil)); end # Sets an HTTP 1.1 Cache-Control header of no-cache. This means the # resource will be marked as stale, so clients must always revalidate. # Intermediate/browser caches may still store the asset. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#294 def expires_now; end # Sets the +etag+, +last_modified+, or both on the response and renders a # 304 Not Modified response if the request is already fresh. # # === Parameters: # # * :etag Sets a "weak" ETag validator on the response. See the # +:weak_etag+ option. # * :weak_etag Sets a "weak" ETag validator on the response. # Requests that set If-None-Match header may return a 304 Not Modified # response if it matches the ETag exactly. A weak ETag indicates semantic # equivalence, not byte-for-byte equality, so they're good for caching # HTML pages in browser caches. They can't be used for responses that # must be byte-identical, like serving Range requests within a PDF file. # * :strong_etag Sets a "strong" ETag validator on the response. # Requests that set If-None-Match header may return a 304 Not Modified # response if it matches the ETag exactly. A strong ETag implies exact # equality: the response must match byte for byte. This is necessary for # doing Range requests within a large video or PDF file, for example, or # for compatibility with some CDNs that don't support weak ETags. # * :last_modified Sets a "weak" last-update validator on the # response. Subsequent requests that set If-Modified-Since may return a # 304 Not Modified response if last_modified <= If-Modified-Since. # * :public By default the Cache-Control header is private, set this to # +true+ if you want your application to be cacheable by other devices (proxy caches). # * :cache_control When given will overwrite an existing Cache-Control header. # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. # * :template By default, the template digest for the current # controller/action is included in ETags. If the action renders a # different template, you can include its digest instead. If the action # doesn't render a template at all, you can pass template: false # to skip any attempt to check for a template digest. # # === Example: # # def show # @article = Article.find(params[:id]) # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) # end # # This will render the show template if the request isn't sending a matching ETag or # If-Modified-Since header and just a 304 Not Modified response if there's a match. # # You can also just pass a record. In this case +last_modified+ will be set # by calling +updated_at+ and +etag+ by passing the object itself. # # def show # @article = Article.find(params[:id]) # fresh_when(@article) # end # # You can also pass an object that responds to +maximum+, such as a # collection of active records. In this case +last_modified+ will be set by # calling maximum(:updated_at) on the collection (the timestamp of the # most recently updated record) and the +etag+ by passing the object itself. # # def index # @articles = Article.all # fresh_when(@articles) # end # # When passing a record or a collection, you can still set the public header: # # def show # @article = Article.find(params[:id]) # fresh_when(@article, public: true) # end # # When overwriting Cache-Control header: # # def show # @article = Article.find(params[:id]) # fresh_when(@article, public: true, cache_control: { no_cache: true }) # end # # This will set in the response Cache-Control = public, no-cache. # # When rendering a different template than the default controller/action # style, you can indicate which digest to include in the ETag: # # before_action { fresh_when @article, template: 'widgets/show' } # # source://actionpack//lib/action_controller/metal/conditional_get.rb#117 def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end # Cache or yield the block. The cache is supposed to never expire. # # You can use this method when you have an HTTP response that never changes, # and the browser and proxies should cache it indefinitely. # # * +public+: By default, HTTP responses are private, cached only on the # user's web browser. To allow proxies to cache the response, set +true+ to # indicate that they can serve the cached response to all users. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#306 def http_cache_forever(public: T.unsafe(nil)); end # Sets an HTTP 1.1 Cache-Control header of no-store. This means the # resource may not be stored in any cache. # # source://actionpack//lib/action_controller/metal/conditional_get.rb#316 def no_store; end # Sets the +etag+ and/or +last_modified+ on the response and checks it against # the client request. If the request doesn't match the options provided, the # request is considered stale and should be generated from scratch. Otherwise, # it's fresh and we don't need to generate anything and a reply of 304 Not Modified is sent. # # === Parameters: # # * :etag Sets a "weak" ETag validator on the response. See the # +:weak_etag+ option. # * :weak_etag Sets a "weak" ETag validator on the response. # Requests that set If-None-Match header may return a 304 Not Modified # response if it matches the ETag exactly. A weak ETag indicates semantic # equivalence, not byte-for-byte equality, so they're good for caching # HTML pages in browser caches. They can't be used for responses that # must be byte-identical, like serving Range requests within a PDF file. # * :strong_etag Sets a "strong" ETag validator on the response. # Requests that set If-None-Match header may return a 304 Not Modified # response if it matches the ETag exactly. A strong ETag implies exact # equality: the response must match byte for byte. This is necessary for # doing Range requests within a large video or PDF file, for example, or # for compatibility with some CDNs that don't support weak ETags. # * :last_modified Sets a "weak" last-update validator on the # response. Subsequent requests that set If-Modified-Since may return a # 304 Not Modified response if last_modified <= If-Modified-Since. # * :public By default the Cache-Control header is private, set this to # +true+ if you want your application to be cacheable by other devices (proxy caches). # * :cache_control When given will overwrite an existing Cache-Control header. # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. # * :template By default, the template digest for the current # controller/action is included in ETags. If the action renders a # different template, you can include its digest instead. If the action # doesn't render a template at all, you can pass template: false # to skip any attempt to check for a template digest. # # === Example: # # def show # @article = Article.find(params[:id]) # # if stale?(etag: @article, last_modified: @article.updated_at) # @statistics = @article.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # You can also just pass a record. In this case +last_modified+ will be set # by calling +updated_at+ and +etag+ by passing the object itself. # # def show # @article = Article.find(params[:id]) # # if stale?(@article) # @statistics = @article.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # You can also pass an object that responds to +maximum+, such as a # collection of active records. In this case +last_modified+ will be set by # calling maximum(:updated_at) on the collection (the timestamp of the # most recently updated record) and the +etag+ by passing the object itself. # # def index # @articles = Article.all # # if stale?(@articles) # @statistics = @articles.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # When passing a record or a collection, you can still set the public header: # # def show # @article = Article.find(params[:id]) # # if stale?(@article, public: true) # @statistics = @article.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # When overwriting Cache-Control header: # # def show # @article = Article.find(params[:id]) # # if stale?(@article, public: true, cache_control: { no_cache: true }) # @statistics = @articles.really_expensive_call # respond_to do |format| # # all the supported formats # end # end # end # # This will set in the response Cache-Control = public, no-cache. # # When rendering a different template than the default controller/action # style, you can indicate which digest to include in the ETag: # # def show # super if stale? @article, template: 'widgets/show' # end # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/conditional_get.rb#249 def stale?(object = T.unsafe(nil), **freshness_kwargs); end private # source://actionpack//lib/action_controller/metal/conditional_get.rb#321 def combine_etags(validator, options); end module GeneratedClassMethods def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etaggers; end def etaggers=(value); end def etaggers?; end end end # source://actionpack//lib/action_controller/metal/conditional_get.rb#16 module ActionController::ConditionalGet::ClassMethods # Allows you to consider additional controller-wide information when generating an ETag. # For example, if you serve pages tailored depending on who's logged in at the moment, you # may want to add the current user id to be part of the ETag to prevent unauthorized displaying # of cached pages. # # class InvoicesController < ApplicationController # etag { current_user&.id } # # def show # # Etag will differ even for the same invoice when it's viewed by a different current_user # @invoice = Invoice.find(params[:id]) # fresh_when etag: @invoice # end # end # # source://actionpack//lib/action_controller/metal/conditional_get.rb#31 def etag(&etagger); end end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#4 module ActionController::ContentSecurityPolicy extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Helpers include ::ActiveSupport::Callbacks include ::AbstractController::Callbacks mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods mixes_in_class_methods ::ActiveSupport::DescendantsTracker mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#73 def content_security_policy?; end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#77 def content_security_policy_nonce; end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#81 def current_content_security_policy; end module GeneratedClassMethods def __callbacks; end def __callbacks=(value); end def __callbacks?; end def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end module GeneratedInstanceMethods def __callbacks; end def __callbacks?; end def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end end end # source://actionpack//lib/action_controller/metal/content_security_policy.rb#15 module ActionController::ContentSecurityPolicy::ClassMethods # Overrides parts of the globally configured Content-Security-Policy # header: # # class PostsController < ApplicationController # content_security_policy do |policy| # policy.base_uri "https://www.example.com" # end # end # # Options can be passed similar to +before_action+. For example, pass # only: :index to override the header on the index action only: # # class PostsController < ApplicationController # content_security_policy(only: :index) do |policy| # policy.default_src :self, :https # end # end # # Pass +false+ to remove the Content-Security-Policy header: # # class PostsController < ApplicationController # content_security_policy false, only: :index # end # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#39 def content_security_policy(enabled = T.unsafe(nil), **options, &block); end # Overrides the globally configured Content-Security-Policy-Report-Only # header: # # class PostsController < ApplicationController # content_security_policy_report_only only: :index # end # # Pass +false+ to remove the Content-Security-Policy-Report-Only header: # # class PostsController < ApplicationController # content_security_policy_report_only false, only: :index # end # # source://actionpack//lib/action_controller/metal/content_security_policy.rb#65 def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end end # source://actionpack//lib/action_controller/metal/cookies.rb#4 module ActionController::Cookies extend ::ActiveSupport::Concern private # The cookies for the current request. See ActionDispatch::Cookies for # more information. # # source://actionpack//lib/action_controller/metal/cookies.rb#14 def cookies; end end # Methods for sending arbitrary data and for streaming files to the browser, # instead of rendering. # # source://actionpack//lib/action_controller/metal/data_streaming.rb#9 module ActionController::DataStreaming extend ::ActiveSupport::Concern include ::ActionController::Rendering mixes_in_class_methods ::ActionController::Rendering::ClassMethods private # Sends the given binary data to the browser. This method is similar to # render plain: data, but also allows you to specify whether # the browser should display the response as a file attachment (i.e. in a # download dialog) or as inline data. You may also set the content type, # the file name, and other things. # # Options: # * :filename - suggests a filename for the browser to use. # * :type - specifies an HTTP content type. Defaults to 'application/octet-stream'. # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. # If omitted, type will be inferred from the file extension specified in :filename. # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. # * :disposition - specifies whether the file will be shown inline or downloaded. # Valid values are 'inline' and 'attachment' (default). # * :status - specifies the status code to send with the response. Defaults to 200. # # Generic data download: # # send_data buffer # # Download a dynamically-generated tarball: # # send_data generate_tgz('dir'), filename: 'dir.tgz' # # Display an image Active Record in the browser: # # send_data image.data, type: image.content_type, disposition: 'inline' # # See +send_file+ for more information on HTTP Content-* headers and caching. # # source://actionpack//lib/action_controller/metal/data_streaming.rb#109 def send_data(data, options = T.unsafe(nil)); end # Sends the file. This uses a server-appropriate method (such as X-Sendfile) # via the Rack::Sendfile middleware. The header to use is set via # +config.action_dispatch.x_sendfile_header+. # Your server can also configure this for you by setting the X-Sendfile-Type header. # # Be careful to sanitize the path parameter if it is coming from a web # page. send_file(params[:path]) allows a malicious user to # download any file on your server. # # Options: # * :filename - suggests a filename for the browser to use. # Defaults to File.basename(path). # * :type - specifies an HTTP content type. # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. # If omitted, the type will be inferred from the file extension specified in :filename. # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. # * :disposition - specifies whether the file will be shown inline or downloaded. # Valid values are 'inline' and 'attachment' (default). # * :status - specifies the status code to send with the response. Defaults to 200. # * :url_based_filename - set to +true+ if you want the browser to guess the filename from # the URL, which is necessary for i18n filenames on certain browsers # (setting :filename overrides this option). # # The default Content-Type and Content-Disposition headers are # set to download arbitrary binary files in as many browsers as # possible. IE versions 4, 5, 5.5, and 6 are all known to have # a variety of quirks (especially when downloading over SSL). # # Simple download: # # send_file '/path/to.zip' # # Show a JPEG in the browser: # # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' # # Show a 404 page in the browser: # # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 # # Read about the other Content-* HTTP headers if you'd like to # provide the user with more information (such as Content-Description) in # https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11. # # Also be aware that the document may be cached by proxies and browsers. # The Pragma and Cache-Control headers declare how the file may be cached # by intermediaries. They default to require clients to validate with # the server before releasing cached responses. See # https://www.mnot.net/cache_docs/ for an overview of web caching and # https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 # for the Cache-Control header spec. # # @raise [MissingFile] # # source://actionpack//lib/action_controller/metal/data_streaming.rb#69 def send_file(path, options = T.unsafe(nil)); end # @raise [ArgumentError] # # source://actionpack//lib/action_controller/metal/data_streaming.rb#114 def send_file_headers!(options); end end # source://actionpack//lib/action_controller/metal/data_streaming.rb#15 ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_controller/metal/data_streaming.rb#14 ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) # Allows configuring default headers that will be automatically merged into # each response. # # source://actionpack//lib/action_controller/metal/default_headers.rb#6 module ActionController::DefaultHeaders extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods end # source://actionpack//lib/action_controller/metal/default_headers.rb#9 module ActionController::DefaultHeaders::ClassMethods # source://actionpack//lib/action_controller/metal/default_headers.rb#10 def make_response!(request); end end # When you're using the flash, it's generally used as a conditional on the view. # This means the content of the view depends on the flash. Which in turn means # that the ETag for a response should be computed with the content of the flash # in mind. This does that by including the content of the flash as a component # in the ETag that's generated for a response. # # source://actionpack//lib/action_controller/metal/etag_with_flash.rb#9 module ActionController::EtagWithFlash extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionController::ConditionalGet mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods module GeneratedClassMethods def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etaggers; end def etaggers=(value); end def etaggers?; end end end # When our views change, they should bubble up into HTTP cache freshness # and bust browser caches. So the template digest for the current action # is automatically included in the ETag. # # Enabled by default for apps that use Action View. Disable by setting # # config.action_controller.etag_with_template_digest = false # # Override the template to digest by passing +:template+ to +fresh_when+ # and +stale?+ calls. For example: # # # We're going to render widgets/show, not posts/show # fresh_when @post, template: 'widgets/show' # # # We're not going to render a template, so omit it from the ETag. # fresh_when @post, template: false # # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#21 module ActionController::EtagWithTemplateDigest extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionController::ConditionalGet mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods private # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#35 def determine_template_etag(options); end # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#51 def lookup_and_digest_template(template); end # Pick the template digest to include in the ETag. If the +:template+ option # is present, use the named template. If +:template+ is +nil+ or absent, use # the default controller/action template. If +:template+ is false, omit the # template digest from the ETag. # # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#45 def pick_template_for_etag(options); end module GeneratedClassMethods def etag_with_template_digest; end def etag_with_template_digest=(value); end def etag_with_template_digest?; end def etaggers; end def etaggers=(value); end def etaggers?; end end module GeneratedInstanceMethods def etag_with_template_digest; end def etag_with_template_digest=(value); end def etag_with_template_digest?; end def etaggers; end def etaggers=(value); end def etaggers?; end end end # source://actionpack//lib/action_controller/metal/flash.rb#4 module ActionController::Flash extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::Flash::ClassMethods private # source://actionpack//lib/action_controller/metal/flash.rb#51 def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end module GeneratedClassMethods def _flash_types; end def _flash_types=(value); end def _flash_types?; end end module GeneratedInstanceMethods; end end # source://actionpack//lib/action_controller/metal/flash.rb#14 module ActionController::Flash::ClassMethods # source://actionpack//lib/action_controller/metal/flash.rb#45 def action_methods; end # Creates new flash types. You can pass as many types as you want to create # flash types other than the default alert and notice in # your controllers and views. For instance: # # # in application_controller.rb # class ApplicationController < ActionController::Base # add_flash_types :warning # end # # # in your controller # redirect_to user_path(@user), warning: "Incomplete profile" # # # in your view # <%= warning %> # # This method will automatically define a new method for each of the given # names, and it will be available in your views. # # source://actionpack//lib/action_controller/metal/flash.rb#32 def add_flash_types(*types); end end # Override the default form builder for all views rendered by this # controller and any of its descendants. Accepts a subclass of # ActionView::Helpers::FormBuilder. # # For example, given a form builder: # # class AdminFormBuilder < ActionView::Helpers::FormBuilder # def special_field(name) # end # end # # The controller specifies a form builder as its default: # # class AdminAreaController < ApplicationController # default_form_builder AdminFormBuilder # end # # Then in the view any form using +form_for+ will be an instance of the # specified form builder: # # <%= form_for(@instance) do |builder| %> # <%= builder.special_field(:name) %> # <% end %> # # source://actionpack//lib/action_controller/form_builder.rb#27 module ActionController::FormBuilder extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods # Default form builder for the controller # # source://actionpack//lib/action_controller/form_builder.rb#46 def default_form_builder; end module GeneratedClassMethods def _default_form_builder; end def _default_form_builder=(value); end def _default_form_builder?; end end module GeneratedInstanceMethods; end end # source://actionpack//lib/action_controller/form_builder.rb#34 module ActionController::FormBuilder::ClassMethods # Set the form builder to be used as the default for all forms # in the views rendered by this controller and its subclasses. # # ==== Parameters # * builder - Default form builder, an instance of ActionView::Helpers::FormBuilder # # source://actionpack//lib/action_controller/form_builder.rb#40 def default_form_builder(builder); end end # source://actionpack//lib/action_controller/metal/head.rb#4 module ActionController::Head # Returns a response that has no content (merely headers). The options # argument is interpreted to be a hash of header names and values. # This allows you to easily return a response that consists only of # significant headers: # # head :created, location: person_path(@person) # # head :created, location: @person # # It can also be used to return exceptional conditions: # # return head(:method_not_allowed) unless request.post? # return head(:bad_request) unless valid_request? # render # # See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list of valid +status+ symbols. # # source://actionpack//lib/action_controller/metal/head.rb#21 def head(status, options = T.unsafe(nil)); end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/head.rb#52 def include_content?(status); end end # The \Rails framework provides a large number of helpers for working with assets, dates, forms, # numbers and model objects, to name a few. These helpers are available to all templates # by default. # # In addition to using the standard template helpers provided, creating custom helpers to # extract complicated logic or reusable functionality is strongly encouraged. By default, each controller # will include all helpers. These helpers are only accessible on the controller through #helpers # # In previous versions of \Rails the controller will include a helper which # matches the name of the controller, e.g., MyController will automatically # include MyHelper. You can revert to the old behavior with the following: # # # config/application.rb # class Application < Rails::Application # config.action_controller.include_all_helpers = false # end # # Additional helpers can be specified using the +helper+ class method in ActionController::Base or any # controller which inherits from it. # # The +to_s+ method from the \Time class can be wrapped in a helper method to display a custom message if # a \Time object is blank: # # module FormattedTimeHelper # def format_time(time, format=:long, blank_message=" ") # time.blank? ? blank_message : time.to_fs(format) # end # end # # FormattedTimeHelper can now be included in a controller, using the +helper+ class method: # # class EventsController < ActionController::Base # helper FormattedTimeHelper # def index # @events = Event.all # end # end # # Then, in any view rendered by EventsController, the format_time method can be called: # # <% @events.each do |event| -%> #

# <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> #

# <% end -%> # # Finally, assuming we have two event instances, one which has a time and one which does not, # the output might look like this: # # 23 Aug 11:30 | Carolina Railhawks Soccer Match # N/A | Carolina Railhawks Training Workshop # # source://actionpack//lib/action_controller/metal/helpers.rb#56 module ActionController::Helpers extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::AbstractController::Helpers mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::Helpers::ClassMethods mixes_in_class_methods ::ActionController::Helpers::ClassMethods # Provides a proxy to access helper methods from outside the view. # # source://actionpack//lib/action_controller/metal/helpers.rb#128 def helpers; end class << self # Returns the value of attribute helpers_path. # # source://actionpack//lib/action_controller/metal/helpers.rb#59 def helpers_path; end # Sets the attribute helpers_path # # @param value the value to set the attribute helpers_path to. # # source://actionpack//lib/action_controller/metal/helpers.rb#59 def helpers_path=(_arg0); end end module GeneratedClassMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end def helpers_path; end def helpers_path=(value); end def helpers_path?; end def include_all_helpers; end def include_all_helpers=(value); end def include_all_helpers?; end end module GeneratedInstanceMethods def _helper_methods; end def _helper_methods=(value); end def _helper_methods?; end def helpers_path; end def helpers_path=(value); end def helpers_path?; end def include_all_helpers; end def include_all_helpers=(value); end def include_all_helpers?; end end end # source://actionpack//lib/action_controller/metal/helpers.rb#67 module ActionController::Helpers::ClassMethods # Returns a list of helper names in a given path. # # ActionController::Base.all_helpers_from_path 'app/helpers' # # => ["application", "chart", "rubygems"] # # source://actionpack//lib/action_controller/metal/helpers.rb#111 def all_helpers_from_path(path); end # Declares helper accessors for controller attributes. For example, the # following adds new +name+ and name= instance methods to a # controller and makes them available to the view: # attr_accessor :name # helper_attr :name # # ==== Parameters # * attrs - Names of attributes to be converted into helpers. # # source://actionpack//lib/action_controller/metal/helpers.rb#76 def helper_attr(*attrs); end # Provides a proxy to access helper methods from outside the view. # # Note that the proxy is rendered under a different view context. # This may cause incorrect behaviour with capture methods. Consider # using {helper}[rdoc-ref:AbstractController::Helpers::ClassMethods#helper] # instead when using +capture+. # # source://actionpack//lib/action_controller/metal/helpers.rb#86 def helpers; end # Override modules_for_helpers to accept +:all+ as argument, which loads # all helpers in helpers_path. # # ==== Parameters # * args - A list of helpers # # ==== Returns # * array - A normalized list of modules for the list of helpers provided. # # source://actionpack//lib/action_controller/metal/helpers.rb#102 def modules_for_helpers(args); end private # Extract helper names from files in app/helpers/**/*_helper.rb # # source://actionpack//lib/action_controller/metal/helpers.rb#122 def all_application_helpers; end end # HTTP Basic, Digest, and Token authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#9 module ActionController::HttpAuthentication; end # = HTTP \Basic authentication # # === Simple \Basic example # # class PostsController < ApplicationController # http_basic_authenticate_with name: "dhh", password: "secret", except: :index # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # end # # === Advanced \Basic example # # Here is a more advanced \Basic example where only Atom feeds and the XML API are protected by HTTP authentication. # The regular HTML interface is protected by a session approach: # # class ApplicationController < ActionController::Base # before_action :set_account, :authenticate # # private # def set_account # @account = Account.find_by(url_name: request.subdomains.first) # end # # def authenticate # case request.format # when Mime[:xml], Mime[:atom] # if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } # @current_user = user # else # request_http_basic_authentication # end # else # if session_authenticated? # @current_user = @account.users.find(session[:authenticated][:user_id]) # else # redirect_to(login_url) and return false # end # end # end # end # # In your integration tests, you can do something like this: # # def test_access_granted_from_xml # authorization = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) # # get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } # # assert_equal 200, status # end # # source://actionpack//lib/action_controller/metal/http_authentication.rb#66 module ActionController::HttpAuthentication::Basic extend ::ActionController::HttpAuthentication::Basic # source://actionpack//lib/action_controller/metal/http_authentication.rb#127 def auth_param(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#123 def auth_scheme(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#105 def authenticate(request, &login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#135 def authentication_request(controller, realm, message); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#119 def decode_credentials(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#131 def encode_credentials(user_name, password); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#111 def has_basic_credentials?(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#115 def user_name_and_password(request); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#69 module ActionController::HttpAuthentication::Basic::ControllerMethods extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods # source://actionpack//lib/action_controller/metal/http_authentication.rb#92 def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#96 def authenticate_with_http_basic(&login_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#83 def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#100 def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#72 module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods # Enables HTTP \Basic authentication. # # See ActionController::HttpAuthentication::Basic for example usage. # # @raise [ArgumentError] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#76 def http_basic_authenticate_with(name:, password:, realm: T.unsafe(nil), **options); end end # = HTTP \Digest authentication # # === Simple \Digest example # # require "openssl" # class PostsController < ApplicationController # REALM = "SuperSecret" # USERS = {"dhh" => "secret", #plain text password # "dap" => OpenSSL::Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password # # before_action :authenticate, except: [:index] # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # # private # def authenticate # authenticate_or_request_with_http_digest(REALM) do |username| # USERS[username] # end # end # end # # === Notes # # The +authenticate_or_request_with_http_digest+ block must return the user's password # or the ha1 digest hash so the framework can appropriately hash to check the user's # credentials. Returning +nil+ will cause authentication to fail. # # Storing the ha1 hash: MD5(username:realm:password), is better than storing a plain password. If # the password file or database is compromised, the attacker would be able to use the ha1 hash to # authenticate as the user at this +realm+, but would not have the user's password to try using at # other sites. # # In rare instances, web servers or front proxies strip authorization headers before # they reach your application. You can debug this situation by logging all environment # variables, and check for HTTP_AUTHORIZATION, amongst others. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#185 module ActionController::HttpAuthentication::Digest extend ::ActionController::HttpAuthentication::Digest # Returns false on a valid response, true otherwise. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#211 def authenticate(request, realm, &password_procedure); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#269 def authentication_header(controller, realm); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#276 def authentication_request(controller, realm, message = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#262 def decode_credentials(header); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#258 def decode_credentials_header(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#253 def encode_credentials(http_method, credentials, password, password_is_ha1); end # Returns the expected response for a request of +http_method+ to +uri+ with the decoded +credentials+ and the expected +password+ # Optional parameter +password_is_ha1+ is set to +true+ by default, since best practice is to store ha1 digest instead # of a plain-text password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#243 def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#249 def ha1(credentials, password); end # Uses an MD5 digest based on time to generate a value to be used only once. # # A server-specified data string which should be uniquely generated each time a 401 response is made. # It is recommended that this string be base64 or hexadecimal data. # Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed. # # The contents of the nonce are implementation dependent. # The quality of the implementation depends on a good choice. # A nonce might, for example, be constructed as the base 64 encoding of # # time-stamp H(time-stamp ":" ETag ":" private-key) # # where time-stamp is a server-generated time or other non-repeating value, # ETag is the value of the HTTP ETag header associated with the requested entity, # and private-key is data known only to the server. # With a nonce of this form a server would recalculate the hash portion after receiving the client authentication header and # reject the request if it did not match the nonce from that header or # if the time-stamp value is not recent enough. In this way the server can limit the time of the nonce's validity. # The inclusion of the ETag prevents a replay request for an updated version of the resource. # (Note: including the IP address of the client in the nonce would appear to offer the server the ability # to limit the reuse of the nonce to the same client that originally got it. # However, that would break proxy farms, where requests from a single user often go through different proxies in the farm. # Also, IP address spoofing is not that hard.) # # An implementation might choose not to accept a previously used nonce or a previously used digest, in order to # protect against a replay attack. Or, an implementation might choose to use one-time nonces or digests for # POST, PUT, or PATCH requests, and a time-stamp for GET requests. For more details on the issues involved see Section 4 # of this document. # # The nonce is opaque to the client. Composed of Time, and hash of Time with secret # key from the Rails session secret generated upon creation of project. Ensures # the time cannot be modified by client. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#321 def nonce(secret_key, time = T.unsafe(nil)); end # Opaque based on digest of secret key # # source://actionpack//lib/action_controller/metal/http_authentication.rb#340 def opaque(secret_key); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#283 def secret_token(request); end # Returns false unless the request credentials response value matches the expected value. # First try the password as a ha1 digest password. If this fails, then try it as a plain # text password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#218 def validate_digest_response(request, realm, &password_procedure); end # Might want a shorter timeout depending on whether the request # is a PATCH, PUT, or POST, and if the client is a browser or web service. # Can be much shorter if the Stale directive is implemented. This would # allow a user to use new nonce without prompting the user again for their # username and password. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#333 def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#188 module ActionController::HttpAuthentication::Digest::ControllerMethods # Authenticate using an HTTP \Digest, or otherwise render an HTTP header # requesting the client to send a \Digest. # # See ActionController::HttpAuthentication::Digest for example usage. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#193 def authenticate_or_request_with_http_digest(realm = T.unsafe(nil), message = T.unsafe(nil), &password_procedure); end # Authenticate using an HTTP \Digest. Returns true if authentication is # successful, false otherwise. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#199 def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end # Render an HTTP header requesting the client to send a \Digest for # authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#205 def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # = HTTP \Token authentication # # === Simple \Token example # # class PostsController < ApplicationController # TOKEN = "secret" # # before_action :authenticate, except: [ :index ] # # def index # render plain: "Everyone can see me!" # end # # def edit # render plain: "I'm only accessible if you know the password" # end # # private # def authenticate # authenticate_or_request_with_http_token do |token, options| # # Compare the tokens in a time-constant manner, to mitigate # # timing attacks. # ActiveSupport::SecurityUtils.secure_compare(token, TOKEN) # end # end # end # # # Here is a more advanced Token example where only Atom feeds and the XML API are protected by HTTP token authentication. # The regular HTML interface is protected by a session approach: # # class ApplicationController < ActionController::Base # before_action :set_account, :authenticate # # private # def set_account # @account = Account.find_by(url_name: request.subdomains.first) # end # # def authenticate # case request.format # when Mime[:xml], Mime[:atom] # if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) } # @current_user = user # else # request_http_token_authentication # end # else # if session_authenticated? # @current_user = @account.users.find(session[:authenticated][:user_id]) # else # redirect_to(login_url) and return false # end # end # end # end # # # In your integration tests, you can do something like this: # # def test_access_granted_from_xml # authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) # # get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } # # assert_equal 200, status # end # # # On shared hosts, Apache sometimes doesn't pass authentication headers to # FCGI instances. If your environment matches this description and you cannot # authenticate, try this rule in your Apache setup: # # RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] # # source://actionpack//lib/action_controller/metal/http_authentication.rb#419 module ActionController::HttpAuthentication::Token extend ::ActionController::HttpAuthentication::Token # If token Authorization header is present, call the login # procedure with the present token and options. # # Returns the return value of login_procedure if a # token is found. Returns nil if no token is found. # # ==== Parameters # # * +controller+ - ActionController::Base instance for the current request. # * +login_procedure+ - Proc to call if a token is present. The Proc # should take two arguments: # # authenticate(controller) { |token, options| ... } # # source://actionpack//lib/action_controller/metal/http_authentication.rb#461 def authenticate(controller, &login_procedure); end # Sets a WWW-Authenticate header to let the client know a token is desired. # # Returns nothing. # # ==== Parameters # # * +controller+ - ActionController::Base instance for the outgoing response. # * +realm+ - String realm to use in the header. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#541 def authentication_request(controller, realm, message = T.unsafe(nil)); end # Encodes the given token and options into an Authorization header value. # # Returns String. # # ==== Parameters # # * +token+ - String token. # * +options+ - Optional Hash of the options. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#526 def encode_credentials(token, options = T.unsafe(nil)); end # Takes +raw_params+ and turns it into an array of parameters. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#496 def params_array_from(raw_params); end # This method takes an authorization body and splits up the key-value # pairs by the standardized :, ;, or \t # delimiters defined in +AUTHN_PAIR_DELIMITERS+. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#508 def raw_params(auth); end # This removes the " characters wrapping the value. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#501 def rewrite_param_values(array_params); end # Parses the token and options out of the token Authorization header. # The value for the Authorization header is expected to have the prefix # "Token" or "Bearer". If the header looks like this: # # Authorization: Token token="abc", nonce="def" # # Then the returned token is "abc", and the options are # {nonce: "def"}. # # Returns an +Array+ of [String, Hash] if a token is present. # Returns +nil+ if no token is found. # # ==== Parameters # # * +request+ - ActionDispatch::Request instance with the current headers. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#483 def token_and_options(request); end # source://actionpack//lib/action_controller/metal/http_authentication.rb#491 def token_params_from(auth); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#422 ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_controller/metal/http_authentication.rb#425 module ActionController::HttpAuthentication::Token::ControllerMethods # Authenticate using an HTTP Bearer token, or otherwise render an HTTP # header requesting the client to send a Bearer token. # # See ActionController::HttpAuthentication::Token for example usage. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#430 def authenticate_or_request_with_http_token(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end # Authenticate using an HTTP Bearer token. Returns true if # authentication is successful, false otherwise. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#436 def authenticate_with_http_token(&login_procedure); end # Render an HTTP header requesting the client to send a Bearer token for # authentication. # # source://actionpack//lib/action_controller/metal/http_authentication.rb#442 def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/http_authentication.rb#420 ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_controller/metal/http_authentication.rb#421 ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) # Handles implicit rendering for a controller action that does not # explicitly respond with +render+, +respond_to+, +redirect+, or +head+. # # For API controllers, the implicit response is always 204 No Content. # # For all other controllers, we use these heuristics to decide whether to # render a template, raise an error for a missing template, or respond with # 204 No Content: # # First, if we DO find a template, it's rendered. Template lookup accounts # for the action name, locales, format, variant, template handlers, and more # (see +render+ for details). # # Second, if we DON'T find a template but the controller action does have # templates for other formats, variants, etc., then we trust that you meant # to provide a template for this response, too, and we raise # ActionController::UnknownFormat with an explanation. # # Third, if we DON'T find a template AND the request is a page load in a web # browser (technically, a non-XHR GET request for an HTML response) where # you reasonably expect to have rendered a template, then we raise # ActionController::MissingExactTemplate with an explanation. # # Finally, if we DON'T find a template AND the request isn't a browser page # load, then we implicitly respond with 204 No Content. # # source://actionpack//lib/action_controller/metal/implicit_render.rb#29 module ActionController::ImplicitRender include ::ActionController::BasicImplicitRender # source://actionpack//lib/action_controller/metal/implicit_render.rb#33 def default_render; end # source://actionpack//lib/action_controller/metal/implicit_render.rb#52 def method_for_action(action_name); end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/implicit_render.rb#59 def interactive_browser_request?; end end # Adds instrumentation to several ends in ActionController::Base. It also provides # some hooks related with process_action. This allows an ORM like Active Record # and/or DataMapper to plug in ActionController and show related information. # # Check ActiveRecord::Railties::ControllerRuntime for an example. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#12 module ActionController::Instrumentation extend ::ActiveSupport::Concern include ::ActiveSupport::Benchmarkable include ::AbstractController::Logger mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods # source://actionpack//lib/action_controller/metal/instrumentation.rb#40 def redirect_to(*_arg0); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#19 def render(*_arg0); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#34 def send_data(data, options = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#27 def send_file(path, options = T.unsafe(nil)); end def view_runtime; end def view_runtime=(_arg0); end private # Every time after an action is processed, this method is invoked # with the payload, so you can add more information. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#96 def append_info_to_payload(payload); end # A hook which allows you to clean up any time, wrongly taken into account in # views, like database querying time. # # def cleanup_view_runtime # super - time_taken_in_something_expensive # end # # source://actionpack//lib/action_controller/metal/instrumentation.rb#90 def cleanup_view_runtime; end # A hook invoked every time a before callback is halted. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#80 def halted_callback_hook(filter, _); end # source://actionpack//lib/action_controller/metal/instrumentation.rb#50 def process_action(*_arg0); end end # source://actionpack//lib/action_controller/metal/instrumentation.rb#100 module ActionController::Instrumentation::ClassMethods # A hook which allows other frameworks to log what happened during # controller process action. This method should return an array # with the messages to be added. # # source://actionpack//lib/action_controller/metal/instrumentation.rb#104 def log_process_action(payload); end end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#8 class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#11 class ActionController::InvalidCrossOriginRequest < ::ActionController::ActionControllerError; end # Mix this module into your controller, and all actions in that controller # will be able to stream data to the client as it's written. # # class MyController < ActionController::Base # include ActionController::Live # # def stream # response.headers['Content-Type'] = 'text/event-stream' # 100.times { # response.stream.write "hello world\n" # sleep 1 # } # ensure # response.stream.close # end # end # # There are a few caveats with this module. You *cannot* write headers after the # response has been committed (Response#committed? will return truthy). # Calling +write+ or +close+ on the response stream will cause the response # object to be committed. Make sure all headers are set before calling write # or close on your stream. # # You *must* call close on your stream when you're finished, otherwise the # socket may be left open forever. # # The final caveat is that your actions are executed in a separate thread than # the main thread. Make sure your actions are thread safe, and this shouldn't # be a problem (don't share state across threads, etc). # # source://actionpack//lib/action_controller/metal/live.rb#37 module ActionController::Live extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::Live::ClassMethods # source://actionpack//lib/action_controller/test_case.rb#24 def new_controller_thread; end # source://actionpack//lib/action_controller/metal/live.rb#249 def process(name); end # source://actionpack//lib/action_controller/metal/live.rb#295 def response_body=(body); end # Sends a stream to the browser, which is helpful when you're generating exports or other running data where you # don't want the entire file buffered in memory first. Similar to send_data, but where the data is generated live. # # Options: # * :filename - suggests a filename for the browser to use. # * :type - specifies an HTTP content type. # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. # If omitted, type will be inferred from the file extension specified in :filename. # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. # * :disposition - specifies whether the file will be shown inline or downloaded. # Valid values are 'inline' and 'attachment' (default). # # Example of generating a csv export: # # send_stream(filename: "subscribers.csv") do |stream| # stream.write "email_address,updated_at\n" # # @subscribers.find_each do |subscriber| # stream.write "#{subscriber.email_address},#{subscriber.updated_at}\n" # end # end # # source://actionpack//lib/action_controller/metal/live.rb#321 def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end private # source://actionpack//lib/action_controller/metal/live.rb#348 def log_error(exception); end end # source://actionpack//lib/action_controller/metal/live.rb#127 class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer include ::MonitorMixin # @return [Buffer] a new instance of Buffer # # source://actionpack//lib/action_controller/metal/live.rb#143 def initialize(response); end # Inform the producer/writing thread that the client has # disconnected; the reading thread is no longer interested in # anything that's being written. # # See also #close. # # source://actionpack//lib/action_controller/metal/live.rb#193 def abort; end # source://actionpack//lib/action_controller/metal/live.rb#212 def call_on_error; end # Write a 'close' event to the buffer; the producer/writing thread # uses this to notify us that it's finished supplying content. # # See also #abort. # # source://actionpack//lib/action_controller/metal/live.rb#180 def close; end # Is the client still connected and waiting for content? # # The result of calling `write` when this is `false` is determined # by `ignore_disconnect`. # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/live.rb#204 def connected?; end # Ignore that the client has disconnected. # # If this value is `true`, calling `write` after the client # disconnects will result in the written content being silently # discarded. If this value is `false` (the default), a # ClientDisconnected exception will be raised. # # source://actionpack//lib/action_controller/metal/live.rb#141 def ignore_disconnect; end # Ignore that the client has disconnected. # # If this value is `true`, calling `write` after the client # disconnects will result in the written content being silently # discarded. If this value is `false` (the default), a # ClientDisconnected exception will be raised. # # source://actionpack//lib/action_controller/metal/live.rb#141 def ignore_disconnect=(_arg0); end # source://actionpack//lib/action_controller/metal/live.rb#208 def on_error(&block); end # source://actionpack//lib/action_controller/metal/live.rb#151 def write(string); end # Same as +write+ but automatically include a newline at the end of the string. # # source://actionpack//lib/action_controller/metal/live.rb#172 def writeln(string); end private # source://actionpack//lib/action_controller/metal/live.rb#228 def build_queue(queue_size); end # source://actionpack//lib/action_controller/metal/live.rb#217 def each_chunk(&block); end class << self # Returns the value of attribute queue_size. # # source://actionpack//lib/action_controller/metal/live.rb#131 def queue_size; end # Sets the attribute queue_size # # @param value the value to set the attribute queue_size to. # # source://actionpack//lib/action_controller/metal/live.rb#131 def queue_size=(_arg0); end end end # source://actionpack//lib/action_controller/metal/live.rb#40 module ActionController::Live::ClassMethods # source://actionpack//lib/action_controller/metal/live.rb#41 def make_response!(request); end end # source://actionpack//lib/action_controller/metal/live.rb#124 class ActionController::Live::ClientDisconnected < ::RuntimeError; end # source://actionpack//lib/action_controller/metal/live.rb#233 class ActionController::Live::Response < ::ActionDispatch::Response private # source://actionpack//lib/action_controller/metal/live.rb#235 def before_committed; end # source://actionpack//lib/action_controller/metal/live.rb#242 def build_buffer(response, body); end end # This class provides the ability to write an SSE (Server Sent Event) # to an IO stream. The class is initialized with a stream and can be used # to either write a JSON string or an object which can be converted to JSON. # # Writing an object will convert it into standard SSE format with whatever # options you have configured. You may choose to set the following options: # # 1) Event. If specified, an event with this name will be dispatched on # the browser. # 2) Retry. The reconnection time in milliseconds used when attempting # to send the event. # 3) Id. If the connection dies while sending an SSE to the browser, then # the server will receive a +Last-Event-ID+ header with value equal to +id+. # # After setting an option in the constructor of the SSE object, all future # SSEs sent across the stream will use those options unless overridden. # # Example Usage: # # class MyController < ActionController::Base # include ActionController::Live # # def index # response.headers['Content-Type'] = 'text/event-stream' # sse = SSE.new(response.stream, retry: 300, event: "event-name") # sse.write({ name: 'John'}) # sse.write({ name: 'John'}, id: 10) # sse.write({ name: 'John'}, id: 10, event: "other-event") # sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500) # ensure # sse.close # end # end # # Note: SSEs are not currently supported by IE. However, they are supported # by Chrome, Firefox, Opera, and Safari. # # source://actionpack//lib/action_controller/metal/live.rb#88 class ActionController::Live::SSE # @return [SSE] a new instance of SSE # # source://actionpack//lib/action_controller/metal/live.rb#91 def initialize(stream, options = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/live.rb#96 def close; end # source://actionpack//lib/action_controller/metal/live.rb#100 def write(object, options = T.unsafe(nil)); end private # source://actionpack//lib/action_controller/metal/live.rb#110 def perform_write(json, options); end end # source://actionpack//lib/action_controller/metal/live.rb#89 ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/test_case.rb#169 class ActionController::LiveTestResponse < ::ActionController::Live::Response # Was there a server-side error? # # source://rack/2.2.6.4/lib/rack/response.rb#141 def error?; end # Was the URL not found? # # source://rack/2.2.6.4/lib/rack/response.rb#151 def missing?; end # Was the response successful? # # source://rack/2.2.6.4/lib/rack/response.rb#138 def success?; end end # source://actionpack//lib/action_controller/log_subscriber.rb#4 class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber # source://actionpack//lib/action_controller/log_subscriber.rb#67 def exist_fragment?(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#67 def expire_fragment(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#40 def halted_callback(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#76 def logger; end # source://actionpack//lib/action_controller/log_subscriber.rb#20 def process_action(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#67 def read_fragment(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#48 def redirect_to(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#52 def send_data(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#44 def send_file(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#7 def start_processing(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#56 def unpermitted_parameters(event); end # source://actionpack//lib/action_controller/log_subscriber.rb#67 def write_fragment(event); end end # source://actionpack//lib/action_controller/log_subscriber.rb#5 ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/logging.rb#4 module ActionController::Logging extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::Logging::ClassMethods end # source://actionpack//lib/action_controller/metal/logging.rb#7 module ActionController::Logging::ClassMethods # Set a different log level per request. # # # Use the debug log level if a particular cookie is set. # class ApplicationController < ActionController::Base # log_at :debug, if: -> { cookies[:debug] } # end # # source://actionpack//lib/action_controller/metal/logging.rb#15 def log_at(level, **options); end end # ActionController::Metal is the simplest possible controller, providing a # valid Rack interface without the additional niceties provided by # ActionController::Base. # # A sample metal controller might look like this: # # class HelloController < ActionController::Metal # def index # self.response_body = "Hello World!" # end # end # # And then to route requests to your metal controller, you would add # something like this to config/routes.rb: # # get 'hello', to: HelloController.action(:index) # # The +action+ method returns a valid Rack application for the \Rails # router to dispatch to. # # == Rendering Helpers # # ActionController::Metal by default provides no utilities for rendering # views, partials, or other responses aside from explicitly calling of # response_body=, content_type=, and status=. To # add the render helpers you're used to having in a normal controller, you # can do the following: # # class HelloController < ActionController::Metal # include AbstractController::Rendering # include ActionView::Layouts # append_view_path "#{Rails.root}/app/views" # # def index # render "hello/index" # end # end # # == Redirection Helpers # # To add redirection helpers to your metal controller, do the following: # # class HelloController < ActionController::Metal # include ActionController::Redirecting # include Rails.application.routes.url_helpers # # def index # redirect_to root_url # end # end # # == Other Helpers # # You can refer to the modules included in ActionController::Base to see # other features you can bring into your metal controller. # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://actionpack//lib/action_controller/metal.rb#117 class ActionController::Metal < ::AbstractController::Base include ::ActionController::Testing::Functional # @return [Metal] a new instance of Metal # # source://actionpack//lib/action_controller/metal.rb#150 def initialize; end # source://actionpack//lib/action_controller/metal.rb#147 def content_type(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#147 def content_type=(arg); end # Delegates to the class's ::controller_name. # # source://actionpack//lib/action_controller/metal.rb#141 def controller_name; end # source://actionpack//lib/action_controller/metal.rb#185 def dispatch(name, request, response); end # source://actionpack//lib/action_controller/metal.rb#147 def headers(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#147 def location(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#147 def location=(arg); end # source://actionpack//lib/action_controller/metal.rb#147 def media_type(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack; end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack=(_arg0); end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack?; end # source://actionpack//lib/action_controller/metal.rb#157 def params; end # source://actionpack//lib/action_controller/metal.rb#161 def params=(val); end # Tests if render or redirect has already happened. # # @return [Boolean] # # source://actionpack//lib/action_controller/metal.rb#181 def performed?; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def request; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def request=(_arg0); end # source://actionpack//lib/action_controller/metal.rb#206 def reset_session; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def response; end # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 def response=(_arg0); end # source://actionpack//lib/action_controller/metal.rb#172 def response_body=(body); end # source://actionpack//lib/action_controller/metal.rb#147 def response_code(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#146 def session(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#197 def set_request!(request); end # source://actionpack//lib/action_controller/metal.rb#193 def set_response!(response); end # source://actionpack//lib/action_controller/metal.rb#147 def status(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal.rb#147 def status=(arg); end # source://actionpack//lib/action_controller/metal.rb#202 def to_a; end # Basic url_for that can be overridden for more robust functionality. # # source://actionpack//lib/action_controller/metal.rb#168 def url_for(string); end class << self # Returns a Rack endpoint for the given action name. # # source://actionpack//lib/action_controller/metal.rb#231 def action(name); end # source://actionpack//lib/action_controller/metal.rb#136 def action_encoding_template(action); end # Returns the last part of the controller's name, underscored, without the ending # Controller. For instance, PostsController returns posts. # Namespaces are left out, so Admin::PostsController returns posts as well. # # ==== Returns # * string # # source://actionpack//lib/action_controller/metal.rb#126 def controller_name; end # Direct dispatch to the controller. Instantiates the controller, then # executes the action named +name+. # # source://actionpack//lib/action_controller/metal.rb#247 def dispatch(name, req, res); end # source://actionpack//lib/action_controller/metal.rb#212 def inherited(base); end # source://actionpack//lib/action_controller/metal.rb#130 def make_response!(request); end # Alias for +middleware_stack+. # # source://actionpack//lib/action_controller/metal.rb#226 def middleware; end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack; end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack=(value); end # source://actionpack//lib/action_controller/metal.rb#210 def middleware_stack?; end # Pushes the given Rack middleware and its arguments to the bottom of the # middleware stack. # # source://actionpack//lib/action_controller/metal.rb#220 def use(*_arg0, **_arg1, &_arg2); end end end # source://actionpack//lib/action_controller/metal/exceptions.rb#50 class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError # @return [MethodNotAllowed] a new instance of MethodNotAllowed # # source://actionpack//lib/action_controller/metal/exceptions.rb#51 def initialize(*allowed_methods); end end # Extend ActionDispatch middleware stack to make it aware of options # allowing the following syntax in controllers: # # class PostsController < ApplicationController # use AuthenticationMiddleware, except: [:index, :show] # end # # source://actionpack//lib/action_controller/metal.rb#14 class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack # source://actionpack//lib/action_controller/metal.rb#27 def build(action, app = T.unsafe(nil), &block); end private # source://actionpack//lib/action_controller/metal.rb#40 def build_middleware(klass, args, block); end end # source://actionpack//lib/action_controller/metal.rb#37 ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal.rb#36 ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal.rb#15 class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware # @return [Middleware] a new instance of Middleware # # source://actionpack//lib/action_controller/metal.rb#16 def initialize(klass, args, actions, strategy, block); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal.rb#22 def valid?(action); end end # source://actionpack//lib/action_controller/metal.rb#38 ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_controller/metal/mime_responds.rb#6 module ActionController::MimeResponds # Without web-service support, an action which collects the data for displaying a list of people # might look something like this: # # def index # @people = Person.all # end # # That action implicitly responds to all formats, but formats can also be explicitly enumerated: # # def index # @people = Person.all # respond_to :html, :js # end # # Here's the same action, with web-service support baked in: # # def index # @people = Person.all # # respond_to do |format| # format.html # format.js # format.xml { render xml: @people } # end # end # # What that says is, "if the client wants HTML or JS in response to this action, just respond as we # would have before, but if the client wants XML, return them the list of people in XML format." # (Rails determines the desired response format from the HTTP Accept header submitted by the client.) # # Supposing you have an action that adds a new person, optionally creating their company # (by name) if it does not already exist, without web-services, it might look like this: # # def create # @company = Company.find_or_create_by(name: params[:company][:name]) # @person = @company.people.create(params[:person]) # # redirect_to(person_list_url) # end # # Here's the same action, with web-service support baked in: # # def create # company = params[:person].delete(:company) # @company = Company.find_or_create_by(name: company[:name]) # @person = @company.people.create(params[:person]) # # respond_to do |format| # format.html { redirect_to(person_list_url) } # format.js # format.xml { render xml: @person.to_xml(include: @company) } # end # end # # If the client wants HTML, we just redirect them back to the person list. If they want JavaScript, # then it is an Ajax request and we render the JavaScript template associated with this action. # Lastly, if the client wants XML, we render the created person as XML, but with a twist: we also # include the person's company in the rendered XML, so you get something like this: # # # ... # ... # # ... # ... # ... # # # # Note, however, the extra bit at the top of that action: # # company = params[:person].delete(:company) # @company = Company.find_or_create_by(name: company[:name]) # # This is because the incoming XML document (if a web-service request is in process) can only contain a # single root-node. So, we have to rearrange things so that the request looks like this (url-encoded): # # person[name]=...&person[company][name]=...&... # # And, like this (xml-encoded): # # # ... # # ... # # # # In other words, we make the request so that it operates on a single entity's person. Then, in the action, # we extract the company data from the request, find or create the company, and then create the new person # with the remaining data. # # Note that you can define your own XML parameter parser which would allow you to describe multiple entities # in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow # and accept Rails' defaults, life will be much easier. # # If you need to use a MIME type which isn't supported by default, you can register your own handlers in # +config/initializers/mime_types.rb+ as follows. # # Mime::Type.register "image/jpeg", :jpg # # +respond_to+ also allows you to specify a common block for different formats by using +any+: # # def index # @people = Person.all # # respond_to do |format| # format.html # format.any(:xml, :json) { render request.format.to_sym => @people } # end # end # # In the example above, if the format is xml, it will render: # # render xml: @people # # Or if the format is json: # # render json: @people # # +any+ can also be used with no arguments, in which case it will be used for any format requested by # the user: # # respond_to do |format| # format.html # format.any { redirect_to support_path } # end # # Formats can have different variants. # # The request variant is a specialization of the request format, like :tablet, # :phone, or :desktop. # # We often want to render different html/json/xml templates for phones, # tablets, and desktop browsers. Variants make it easy. # # You can set the variant in a +before_action+: # # request.variant = :tablet if /iPad/.match?(request.user_agent) # # Respond to variants in the action just like you respond to formats: # # respond_to do |format| # format.html do |variant| # variant.tablet # renders app/views/projects/show.html+tablet.erb # variant.phone { extra_setup; render ... } # variant.none { special_setup } # executed only if there is no variant set # end # end # # Provide separate templates for each format and variant: # # app/views/projects/show.html.erb # app/views/projects/show.html+tablet.erb # app/views/projects/show.html+phone.erb # # When you're not sharing any code within the format, you can simplify defining variants # using the inline syntax: # # respond_to do |format| # format.js { render "trash" } # format.html.phone { redirect_to progress_path } # format.html.none { render "trash" } # end # # Variants also support common +any+/+all+ block that formats have. # # It works for both inline: # # respond_to do |format| # format.html.any { render html: "any" } # format.html.phone { render html: "phone" } # end # # and block syntax: # # respond_to do |format| # format.html do |variant| # variant.any(:tablet, :phablet){ render html: "any" } # variant.phone { render html: "phone" } # end # end # # You can also set an array of variants: # # request.variant = [:tablet, :phone] # # This will work similarly to formats and MIME types negotiation. If there # is no +:tablet+ variant declared, the +:phone+ variant will be used: # # respond_to do |format| # format.html.none # format.html.phone # this gets rendered # end # # @raise [ArgumentError] # @yield [collector] # # source://actionpack//lib/action_controller/metal/mime_responds.rb#201 def respond_to(*mimes); end end # A container for responses available from the current controller for # requests for different mime-types sent to a particular action. # # The public controller methods +respond_to+ may be called with a block # that is used to define responses to different mime-types, e.g. # for +respond_to+ : # # respond_to do |format| # format.html # format.xml { render xml: @people } # end # # In this usage, the argument passed to the block (+format+ above) is an # instance of the ActionController::MimeResponds::Collector class. This # object serves as a container in which available responses can be stored by # calling any of the dynamically generated, mime-type-specific methods such # as +html+, +xml+ etc on the Collector. Each response is represented by a # corresponding block if present. # # A subsequent call to #negotiate_format(request) will enable the Collector # to determine which specific mime-type it should respond with for the current # request, with this response then being accessible by calling #response. # # source://actionpack//lib/action_controller/metal/mime_responds.rb#242 class ActionController::MimeResponds::Collector include ::AbstractController::Collector # @return [Collector] a new instance of Collector # # source://actionpack//lib/action_controller/metal/mime_responds.rb#246 def initialize(mimes, variant = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 def all(*args, &block); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 def any(*args, &block); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/mime_responds.rb#271 def any_response?; end # source://actionpack//lib/action_controller/metal/mime_responds.rb#262 def custom(mime_type, &block); end # Returns the value of attribute format. # # source://actionpack//lib/action_controller/metal/mime_responds.rb#244 def format; end # Sets the attribute format # # @param value the value to set the attribute format to. # # source://actionpack//lib/action_controller/metal/mime_responds.rb#244 def format=(_arg0); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#288 def negotiate_format(request); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#275 def response; end end # source://actionpack//lib/action_controller/metal/mime_responds.rb#292 class ActionController::MimeResponds::Collector::VariantCollector # @return [VariantCollector] a new instance of VariantCollector # # source://actionpack//lib/action_controller/metal/mime_responds.rb#293 def initialize(variant = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#298 def all(*args, &block); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#298 def any(*args, &block); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#309 def method_missing(name, *args, &block); end # source://actionpack//lib/action_controller/metal/mime_responds.rb#313 def variant; end private # source://actionpack//lib/action_controller/metal/mime_responds.rb#322 def variant_key; end end # source://actionpack//lib/action_controller/metal/exceptions.rb#94 class ActionController::MissingExactTemplate < ::ActionController::UnknownFormat; end # source://actionpack//lib/action_controller/metal/exceptions.rb#59 class ActionController::MissingFile < ::ActionController::ActionControllerError; end # See Responder#api_behavior # # source://actionpack//lib/action_controller/metal/renderers.rb#17 class ActionController::MissingRenderer < ::LoadError # @return [MissingRenderer] a new instance of MissingRenderer # # source://actionpack//lib/action_controller/metal/renderers.rb#18 def initialize(format); end end # source://actionpack//lib/action_controller/metal/exceptions.rb#56 class ActionController::NotImplemented < ::ActionController::MethodNotAllowed; end # Specify binary encoding for parameters for a given action. # # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#5 module ActionController::ParameterEncoding extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::ParameterEncoding::ClassMethods end # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#8 module ActionController::ParameterEncoding::ClassMethods # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#18 def action_encoding_template(action); end # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#9 def inherited(klass); end # Specify the encoding for a parameter on an action. # If not specified the default is UTF-8. # # You can specify a binary (ASCII_8BIT) parameter with: # # class RepositoryController < ActionController::Base # # This specifies that file_path is not UTF-8 and is instead ASCII_8BIT # param_encoding :show, :file_path, Encoding::ASCII_8BIT # # def show # @repo = Repository.find_by_filesystem_path params[:file_path] # # # params[:repo_name] remains UTF-8 encoded # @repo_name = params[:repo_name] # end # # def index # @repositories = Repository.all # end # end # # The file_path parameter on the show action would be encoded as ASCII-8BIT, # but all other arguments will remain UTF-8 encoded. # This is useful in the case where an application must handle data # but encoding of the data is unknown, like file system data. # # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#77 def param_encoding(action, param, encoding); end # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#14 def setup_param_encode; end # Specify that a given action's parameters should all be encoded as # ASCII-8BIT (it "skips" the encoding default of UTF-8). # # For example, a controller would use it like this: # # class RepositoryController < ActionController::Base # skip_parameter_encoding :show # # def show # @repo = Repository.find_by_filesystem_path params[:file_path] # # # `repo_name` is guaranteed to be UTF-8, but was ASCII-8BIT, so # # tag it as such # @repo_name = params[:repo_name].force_encoding 'UTF-8' # end # # def index # @repositories = Repository.all # end # end # # The show action in the above controller would have all parameter values # encoded as ASCII-8BIT. This is useful in the case where an application # must handle data but encoding of the data is unknown, like file system data. # # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#48 def skip_parameter_encoding(action); end end # Raised when a required parameter is missing. # # params = ActionController::Parameters.new(a: {}) # params.fetch(:b) # # => ActionController::ParameterMissing: param is missing or the value is empty: b # params.require(:a) # # => ActionController::ParameterMissing: param is missing or the value is empty: a # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#21 class ActionController::ParameterMissing < ::KeyError # @return [ParameterMissing] a new instance of ParameterMissing # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#24 def initialize(param, keys = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#33 def corrections; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#22 def keys; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#22 def param; end end # == Action Controller \Parameters # # Allows you to choose which attributes should be permitted for mass updating # and thus prevent accidentally exposing that which shouldn't be exposed. # Provides two methods for this purpose: #require and #permit. The former is # used to mark parameters as required. The latter is used to set the parameter # as permitted and limit which attributes should be allowed for mass updating. # # params = ActionController::Parameters.new({ # person: { # name: "Francesco", # age: 22, # role: "admin" # } # }) # # permitted = params.require(:person).permit(:name, :age) # permitted # => #"Francesco", "age"=>22} permitted: true> # permitted.permitted? # => true # # Person.first.update!(permitted) # # => # # # It provides two options that controls the top-level behavior of new instances: # # * +permit_all_parameters+ - If it's +true+, all the parameters will be # permitted by default. The default is +false+. # * +action_on_unpermitted_parameters+ - Controls behavior when parameters that are not explicitly # permitted are found. The default value is :log in test and development environments, # +false+ otherwise. The values can be: # * +false+ to take no action. # * :log to emit an ActiveSupport::Notifications.instrument event on the # unpermitted_parameters.action_controller topic and log at the DEBUG level. # * :raise to raise a ActionController::UnpermittedParameters exception. # # Examples: # # params = ActionController::Parameters.new # params.permitted? # => false # # ActionController::Parameters.permit_all_parameters = true # # params = ActionController::Parameters.new # params.permitted? # => true # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => # # # ActionController::Parameters.action_on_unpermitted_parameters = :raise # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => ActionController::UnpermittedParameters: found unpermitted keys: a, b # # Please note that these options *are not thread-safe*. In a multi-threaded # environment they should only be set once at boot-time and never mutated at # runtime. # # You can fetch values of ActionController::Parameters using either # :key or "key". # # params = ActionController::Parameters.new(key: "value") # params[:key] # => "value" # params["key"] # => "value" # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#132 class ActionController::Parameters # Returns a new instance of ActionController::Parameters. # Also, sets the +permitted+ attribute to the default value of # ActionController::Parameters.permit_all_parameters. # # class Person < ActiveRecord::Base # end # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => false # Person.new(params) # => ActiveModel::ForbiddenAttributesError # # ActionController::Parameters.permit_all_parameters = true # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => true # Person.new(params) # => # # # @return [Parameters] a new instance of Parameters # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#267 def initialize(parameters = T.unsafe(nil), logging_context = T.unsafe(nil)); end # Returns true if another +Parameters+ object contains the same content and # permitted flag. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#275 def ==(other); end # Returns a parameter for the given +key+. If not found, # returns +nil+. # # params = ActionController::Parameters.new(person: { name: "Francesco" }) # params[:person] # => #"Francesco"} permitted: false> # params[:none] # => nil # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#643 def [](key); end # Assigns a value to a given +key+. The given key may still get filtered out # when +permit+ is called. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#649 def []=(key, value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 def always_permitted_parameters; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 def always_permitted_parameters=(val); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def as_json(*_arg0, **_arg1, &_arg2); end # Returns a new instance of ActionController::Parameters with +nil+ values removed. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#819 def compact; end # Removes all +nil+ values in place and returns +self+, or +nil+ if no changes were made. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#824 def compact!; end # Returns a new instance of ActionController::Parameters without the blank values. # Uses Object#blank? for determining if a value is blank. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#830 def compact_blank; end # Removes all blank values in place and returns self. # Uses Object#blank? for determining if a value is blank. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#836 def compact_blank!; end # Attribute that keeps track of converted arrays, if any, to avoid double # looping in the common use case permit + mass-assignment. Defined in a # method to instantiate it only if needed. # # Testing membership still loops, but it's going to be faster than our own # loop that converts values. Also, we are not going to build a new array # object per fetch. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#407 def converted_arrays; end # Returns duplicate of object including all parameters. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#921 def deep_dup; end # Returns a new ActionController::Parameters instance with the # results of running +block+ once for every key. This includes the keys # from the root hash and from all nested hashes and arrays. The values are unchanged. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#770 def deep_transform_keys(&block); end # Returns the ActionController::Parameters instance changing its keys. # This includes the keys from the root hash and from all nested hashes and arrays. # The values are unchanged. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#779 def deep_transform_keys!(&block); end # Deletes a key-value pair from +Parameters+ and returns the value. If # +key+ is not found, returns +nil+ (or, with optional code block, yields # +key+ and returns the result). Cf. #extract!, which returns the # corresponding +ActionController::Parameters+ object. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#788 def delete(key, &block); end # Removes items that the block evaluates to true and returns self. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#812 def delete_if(&block); end # Extracts the nested parameter from the given +keys+ by calling +dig+ # at each step. Returns +nil+ if any intermediate step is +nil+. # # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) # params.dig(:foo, :bar, :baz) # => 1 # params.dig(:foo, :zot, :xyz) # => nil # # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) # params2.dig(:foo, 1) # => 11 # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#687 def dig(*keys); end # Convert all hashes in values into parameters, then yield each pair in # the same way as Hash#each_pair. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#379 def each(&block); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def each_key(*_arg0, **_arg1, &_arg2); end # Convert all hashes in values into parameters, then yield each pair in # the same way as Hash#each_pair. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#379 def each_pair(&block); end # Convert all hashes in values into parameters, then yield each value in # the same way as Hash#each_value. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#391 def each_value(&block); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def empty?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#916 def encode_with(coder); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#283 def eql?(other); end # Returns a new ActionController::Parameters instance that # filters out the given +keys+. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.except(:a, :b) # => #3} permitted: false> # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#716 def except(*keys); end # Removes and returns the key/value pairs matching the given keys. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.extract!(:a, :b) # => #1, "b"=>2} permitted: false> # params # => #3} permitted: false> # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#725 def extract!(*keys); end # Returns a parameter for the given +key+. If the +key+ # can't be found, there are several options: With no other arguments, # it will raise an ActionController::ParameterMissing error; # if a second argument is given, then that is returned (converted to an # instance of ActionController::Parameters if possible); if a block # is given, then that will be run and its result returned. # # params = ActionController::Parameters.new(person: { name: "Francesco" }) # params.fetch(:person) # => #"Francesco"} permitted: false> # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none # params.fetch(:none, {}) # => # # params.fetch(:none, "Francesco") # => "Francesco" # params.fetch(:none) { "Francesco" } # => "Francesco" # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#666 def fetch(key, *args); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def has_key?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def has_value?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#289 def hash; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def include?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#898 def init_with(coder); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#885 def inspect; end # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#799 def keep_if(&block); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def key?(*_arg0, **_arg1, &_arg2); end # :method: values # # :call-seq: # values() # # Returns a new array of the values of the parameters. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def keys(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def member?(*_arg0, **_arg1, &_arg2); end # Returns a new ActionController::Parameters with all keys from # +other_hash+ merged into current hash. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#848 def merge(other_hash); end # Returns current ActionController::Parameters instance with # +other_hash+ merged into current hash. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#856 def merge!(other_hash); end # Returns a new ActionController::Parameters instance that # includes only the given +filters+ and sets the +permitted+ attribute # for the object to +true+. This is useful for limiting which attributes # should be allowed for mass updating. # # params = ActionController::Parameters.new(user: { name: "Francesco", age: 22, role: "admin" }) # permitted = params.require(:user).permit(:name, :age) # permitted.permitted? # => true # permitted.has_key?(:name) # => true # permitted.has_key?(:age) # => true # permitted.has_key?(:role) # => false # # Only permitted scalars pass the filter. For example, given # # params.permit(:name) # # +:name+ passes if it is a key of +params+ whose associated value is of type # +String+, +Symbol+, +NilClass+, +Numeric+, +TrueClass+, +FalseClass+, # +Date+, +Time+, +DateTime+, +StringIO+, +IO+, # +ActionDispatch::Http::UploadedFile+ or +Rack::Test::UploadedFile+. # Otherwise, the key +:name+ is filtered out. # # You may declare that the parameter should be an array of permitted scalars # by mapping it to an empty array: # # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) # params.permit(tags: []) # # Sometimes it is not possible or convenient to declare the valid keys of # a hash parameter or its internal structure. Just map to an empty hash: # # params.permit(preferences: {}) # # Be careful because this opens the door to arbitrary input. In this # case, +permit+ ensures values in the returned structure are permitted # scalars and filters out anything else. # # You can also use +permit+ on nested parameters, like: # # params = ActionController::Parameters.new({ # person: { # name: "Francesco", # age: 22, # pets: [{ # name: "Purplish", # category: "dogs" # }] # } # }) # # permitted = params.permit(person: [ :name, { pets: :name } ]) # permitted.permitted? # => true # permitted[:person][:name] # => "Francesco" # permitted[:person][:age] # => nil # permitted[:person][:pets][0][:name] # => "Purplish" # permitted[:person][:pets][0][:category] # => nil # # Note that if you use +permit+ in a key that points to a hash, # it won't allow all the hash. You also need to specify which # attributes inside the hash should be permitted. # # params = ActionController::Parameters.new({ # person: { # contact: { # email: "none@test.com", # phone: "555-1234" # } # } # }) # # params.require(:person).permit(:contact) # # => # # # params.require(:person).permit(contact: :phone) # # => ##"555-1234"} permitted: true>} permitted: true> # # params.require(:person).permit(contact: [ :email, :phone ]) # # => ##"none@test.com", "phone"=>"555-1234"} permitted: true>} permitted: true> # # If your parameters specify multiple parameters indexed by a number, # you can permit each set of parameters under the numeric key to be the same using the same syntax as permitting a single item. # # params = ActionController::Parameters.new({ # person: { # '0': { # email: "none@test.com", # phone: "555-1234" # }, # '1': { # email: "nothing@test.com", # phone: "555-6789" # }, # } # }) # params.permit(person: [:email]).to_h # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"email"=>"nothing@test.com"}}} # # If you want to specify what keys you want from each numeric key, you can instead specify each one individually # # params = ActionController::Parameters.new({ # person: { # '0': { # email: "none@test.com", # phone: "555-1234" # }, # '1': { # email: "nothing@test.com", # phone: "555-6789" # }, # } # }) # params.permit(person: { '0': [:email], '1': [:phone]}).to_h # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"phone"=>"555-6789"}}} # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#620 def permit(*filters); end # Sets the +permitted+ attribute to +true+. This can be used to pass # mass assignment. Returns +self+. # # class Person < ActiveRecord::Base # end # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => false # Person.new(params) # => ActiveModel::ForbiddenAttributesError # params.permit! # params.permitted? # => true # Person.new(params) # => # # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#433 def permit!; end # Returns +true+ if the parameter is permitted, +false+ otherwise. # # params = ActionController::Parameters.new # params.permitted? # => false # params.permit! # params.permitted? # => true # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#417 def permitted?; end # Returns a new instance of ActionController::Parameters with items # that the block evaluates to true removed. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#807 def reject(&block); end # Removes items that the block evaluates to true and returns self. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#812 def reject!(&block); end # This method accepts both a single key and an array of keys. # # When passed a single key, if it exists and its associated value is # either present or the singleton +false+, returns said value: # # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) # # => #"Francesco"} permitted: false> # # Otherwise raises ActionController::ParameterMissing: # # ActionController::Parameters.new.require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: nil).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: "\t").require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: {}).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # When given an array of keys, the method tries to require each one of them # in order. If it succeeds, an array with the respective return values is # returned: # # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) # user_params, profile_params = params.require([:user, :profile]) # # Otherwise, the method re-raises the first exception found: # # params = ActionController::Parameters.new(user: {}, profile: {}) # user_params, profile_params = params.require([:user, :profile]) # # ActionController::ParameterMissing: param is missing or the value is empty: user # # Technically this method can be used to fetch terminal values: # # # CAREFUL # params = ActionController::Parameters.new(person: { name: "Finn" }) # name = params.require(:person).require(:name) # CAREFUL # # but take into account that at some point those ones have to be permitted: # # def person_params # params.require(:person).permit(:name).tap do |person_params| # person_params.require(:name) # SAFER # end # end # # for example. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#494 def require(key); end # This method accepts both a single key and an array of keys. # # When passed a single key, if it exists and its associated value is # either present or the singleton +false+, returns said value: # # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) # # => #"Francesco"} permitted: false> # # Otherwise raises ActionController::ParameterMissing: # # ActionController::Parameters.new.require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: nil).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: "\t").require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: {}).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # When given an array of keys, the method tries to require each one of them # in order. If it succeeds, an array with the respective return values is # returned: # # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) # user_params, profile_params = params.require([:user, :profile]) # # Otherwise, the method re-raises the first exception found: # # params = ActionController::Parameters.new(user: {}, profile: {}) # user_params, profile_params = params.require([:user, :profile]) # # ActionController::ParameterMissing: param is missing or the value is empty: user # # Technically this method can be used to fetch terminal values: # # # CAREFUL # params = ActionController::Parameters.new(person: { name: "Finn" }) # name = params.require(:person).require(:name) # CAREFUL # # but take into account that at some point those ones have to be permitted: # # def person_params # params.require(:person).permit(:name).tap do |person_params| # person_params.require(:name) # SAFER # end # end # # for example. # Alias of #require. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#494 def required(key); end # Returns a new ActionController::Parameters with all keys from # current hash merged into +other_hash+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#863 def reverse_merge(other_hash); end # Returns current ActionController::Parameters instance with # current hash merged into +other_hash+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 def reverse_merge!(other_hash); end # Returns a new instance of ActionController::Parameters with only # items that the block evaluates to true. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#794 def select(&block); end # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#799 def select!(&block); end # Returns a new ActionController::Parameters instance that # includes only the given +keys+. If the given +keys+ # don't exist, returns an empty hash. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.slice(:a, :b) # => #1, "b"=>2} permitted: false> # params.slice(:d) # => # # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#699 def slice(*keys); end # Returns current ActionController::Parameters instance which # contains only the given +keys+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#705 def slice!(*keys); end # This is required by ActiveModel attribute assignment, so that user can # pass +Parameters+ to a mass assignment methods in a model. It should not # matter as we are using +HashWithIndifferentAccess+ internally. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#881 def stringify_keys; end # Returns a safe ActiveSupport::HashWithIndifferentAccess # representation of the parameters with all unpermitted keys removed. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_h # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name) # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#305 def to_h; end # Returns a safe Hash representation of the parameters # with all unpermitted keys removed. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_hash # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name) # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"} # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#325 def to_hash; end # Returns a string representation of the receiver suitable for use as a URL # query string: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # params.to_query # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name, :nationality) # safe_params.to_query # # => "name=David&nationality=Danish" # # An optional namespace can be passed to enclose key names: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # safe_params = params.permit(:name, :nationality) # safe_params.to_query("user") # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" # # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # # This method is also aliased as +to_param+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#357 def to_param(*args); end # Returns a string representation of the receiver suitable for use as a URL # query string: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # params.to_query # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name, :nationality) # safe_params.to_query # # => "name=David&nationality=Danish" # # An optional namespace can be passed to enclose key names: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # safe_params = params.permit(:name, :nationality) # safe_params.to_query("user") # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" # # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # # This method is also aliased as +to_param+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#357 def to_query(*args); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def to_s(*_arg0, **_arg1, &_arg2); end # Returns an unsafe, unfiltered # ActiveSupport::HashWithIndifferentAccess representation of the # parameters. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_unsafe_h # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#372 def to_unsafe_h; end # Returns an unsafe, unfiltered # ActiveSupport::HashWithIndifferentAccess representation of the # parameters. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_unsafe_h # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#372 def to_unsafe_hash; end # Returns a new ActionController::Parameters instance with the # results of running +block+ once for every key. The values are unchanged. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#752 def transform_keys(&block); end # Performs keys transformation and returns the altered # ActionController::Parameters instance. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#761 def transform_keys!(&block); end # Returns a new ActionController::Parameters with the results of # running +block+ once for every value. The keys are unchanged. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.transform_values { |x| x * 2 } # # => #2, "b"=>4, "c"=>6} permitted: false> # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#735 def transform_values; end # Performs values transformation and returns the altered # ActionController::Parameters instance. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#744 def transform_values!; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def value?(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 def values(*_arg0, **_arg1, &_arg2); end # Returns values that were assigned to the given +keys+. Note that all the # +Hash+ objects will be converted to ActionController::Parameters. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#842 def values_at(*keys); end # Returns a new ActionController::Parameters with all keys from # current hash merged into +other_hash+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#863 def with_defaults(other_hash); end # Returns current ActionController::Parameters instance with # current hash merged into +other_hash+. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 def with_defaults!(other_hash); end protected # source://actionpack//lib/action_controller/metal/strong_parameters.rb#936 def each_nested_attribute; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#932 def nested_attributes?; end # Returns the value of attribute parameters. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#928 def parameters; end # Sets the attribute permitted # # @param value the value to set the attribute permitted to. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#930 def permitted=(_arg0); end private # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1076 def array_of_permitted_scalars?(value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#964 def convert_hashes_to_parameters(key, value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#949 def convert_parameters_to_hashes(value, using); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#970 def convert_value_to_parameters(value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#990 def each_element(object, filter, &block); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1088 def hash_filter(params, filter); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1147 def initialize_copy(source); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#943 def new_instance_with_inherited_permitted_status(hash); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1082 def non_scalar?(value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1132 def permit_any_in_array(array); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1115 def permit_any_in_parameters(params); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1047 def permitted_scalar?(value); end # Adds existing keys to the params if their values are scalar. # # For example: # # puts self.keys #=> ["zipcode(90210i)"] # params = {} # # permitted_scalar_filter(params, "zipcode") # # puts params.keys # => ["zipcode"] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1061 def permitted_scalar_filter(params, permitted_key); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#984 def specify_numeric_keys?(filter); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1016 def unpermitted_keys(params); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1003 def unpermitted_parameters!(params); end class << self # source://actionpack//lib/action_controller/metal/strong_parameters.rb#135 def action_on_unpermitted_parameters; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#135 def action_on_unpermitted_parameters=(val); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 def always_permitted_parameters; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 def always_permitted_parameters=(val); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#889 def hook_into_yaml_loading; end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#246 def nested_attribute?(key, value); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#133 def permit_all_parameters; end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#133 def permit_all_parameters=(val); end end end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1086 ActionController::Parameters::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1087 ActionController::Parameters::EMPTY_HASH = T.let(T.unsafe(nil), Hash) # This is a list of permitted scalar types that includes the ones # supported in XML and JSON requests. # # This list is in particular used to filter ordinary requests, String goes # as first element to quickly short-circuit the common case. # # If you modify this collection please update the API of +permit+ above. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1031 ActionController::Parameters::PERMITTED_SCALAR_TYPES = T.let(T.unsafe(nil), Array) # Wraps the parameters hash into a nested hash. This will allow clients to # submit requests without having to specify any root elements. # # This functionality is enabled by default for JSON, and can be customized by # setting the format array: # # class ApplicationController < ActionController::Base # wrap_parameters format: [:json, :xml] # end # # You could also turn it on per controller: # # class UsersController < ApplicationController # wrap_parameters format: [:json, :xml, :url_encoded_form, :multipart_form] # end # # If you enable +ParamsWrapper+ for +:json+ format, instead of having to # send JSON parameters like this: # # {"user": {"name": "Konata"}} # # You can send parameters like this: # # {"name": "Konata"} # # And it will be wrapped into a nested hash with the key name matching the # controller's name. For example, if you're posting to +UsersController+, # your new +params+ hash will look like this: # # {"name" => "Konata", "user" => {"name" => "Konata"}} # # You can also specify the key in which the parameters should be wrapped to, # and also the list of attributes it should wrap by using either +:include+ or # +:exclude+ options like this: # # class UsersController < ApplicationController # wrap_parameters :person, include: [:username, :password] # end # # On Active Record models with no +:include+ or +:exclude+ option set, # it will only wrap the parameters returned by the class method # attribute_names. # # If you're going to pass the parameters to an +ActiveModel+ object (such as # User.new(params[:user])), you might consider passing the model class to # the method instead. The +ParamsWrapper+ will actually try to determine the # list of attribute names from the model and only wrap those attributes: # # class UsersController < ApplicationController # wrap_parameters Person # end # # You still could pass +:include+ and +:exclude+ to set the list of attributes # you want to wrap. # # By default, if you don't specify the key in which the parameters would be # wrapped to, +ParamsWrapper+ will actually try to determine if there's # a model related to it or not. This controller, for example: # # class Admin::UsersController < ApplicationController # end # # will try to check if Admin::User or +User+ model exists, and use it to # determine the wrapper key respectively. If both models don't exist, # it will then fallback to use +user+ as the key. # # To disable this functionality for a controller: # # class UsersController < ApplicationController # wrap_parameters false # end # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#80 module ActionController::ParamsWrapper extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::ParamsWrapper::ClassMethods private # source://actionpack//lib/action_controller/metal/params_wrapper.rb#277 def _extract_parameters(parameters); end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#299 def _perform_parameter_wrapping; end # Returns the list of parameters which will be selected for wrapped. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#273 def _wrap_parameters(parameters); end # Checks if we should perform parameters wrapping. # # @return [Boolean] # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#289 def _wrapper_enabled?; end # Returns the list of enabled formats. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#268 def _wrapper_formats; end # Returns the wrapper key which will be used to store wrapped parameters. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#263 def _wrapper_key; end # Performs parameters wrapping upon the request. Called automatically # by the metal call stack. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#257 def process_action(*_arg0); end module GeneratedClassMethods def _wrapper_options; end def _wrapper_options=(value); end def _wrapper_options?; end end module GeneratedInstanceMethods def _wrapper_options; end def _wrapper_options=(value); end def _wrapper_options?; end end end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#188 module ActionController::ParamsWrapper::ClassMethods # source://actionpack//lib/action_controller/metal/params_wrapper.rb#189 def _set_wrapper_options(options); end # Sets the default wrapper key or model which will be used to determine # wrapper key and attribute names. Called automatically when the # module is inherited. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#244 def inherited(klass); end # Sets the name of the wrapper key, or the model which +ParamsWrapper+ # would use to determine the attribute names from. # # ==== Examples # wrap_parameters format: :xml # # enables the parameter wrapper for XML format # # wrap_parameters :person # # wraps parameters into +params[:person]+ hash # # wrap_parameters Person # # wraps parameters by determining the wrapper key from Person class # # (+person+, in this case) and the list of attribute names # # wrap_parameters include: [:username, :title] # # wraps only +:username+ and +:title+ attributes from parameters. # # wrap_parameters false # # disables parameters wrapping for this controller altogether. # # ==== Options # * :format - The list of formats in which the parameters wrapper # will be enabled. # * :include - The list of attribute names which parameters wrapper # will wrap into a nested hash. # * :exclude - The list of attribute names which parameters wrapper # will exclude from a nested hash. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#220 def wrap_parameters(name_or_model_or_options, options = T.unsafe(nil)); end end # source://actionpack//lib/action_controller/metal/params_wrapper.rb#83 ActionController::ParamsWrapper::EXCLUDE_PARAMETERS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_controller/metal/params_wrapper.rb#87 class ActionController::ParamsWrapper::Options < ::Struct include ::Mutex_m # @return [Options] a new instance of Options # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#98 def initialize(name, format, include, exclude, klass, model); end # Returns the value of attribute include # # @return [Object] the current value of include # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#108 def include; end # source://mutex_m/0.1.2/mutex_m.rb#93 def lock; end # source://mutex_m/0.1.2/mutex_m.rb#83 def locked?; end # Returns the value of attribute model # # @return [Object] the current value of model # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#104 def model; end # Returns the value of attribute name # # @return [Object] the current value of name # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#141 def name; end # source://mutex_m/0.1.2/mutex_m.rb#78 def synchronize(&block); end # source://mutex_m/0.1.2/mutex_m.rb#88 def try_lock; end # source://mutex_m/0.1.2/mutex_m.rb#98 def unlock; end private # Determine the wrapper model from the controller's name. By convention, # this could be done by trying to find the defined model that has the # same singular name as the controller. For example, +UsersController+ # will try to find if the +User+ model exists. # # This method also does namespace lookup. Foo::Bar::UsersController will # try to find Foo::Bar::User, Foo::User and finally User. # # source://actionpack//lib/action_controller/metal/params_wrapper.rb#165 def _default_wrap_model; end class << self # source://actionpack//lib/action_controller/metal/params_wrapper.rb#90 def from_hash(hash); end end end # source://actionpack//lib/action_controller/metal/permissions_policy.rb#4 module ActionController::PermissionsPolicy extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::PermissionsPolicy::ClassMethods end # source://actionpack//lib/action_controller/metal/permissions_policy.rb#7 module ActionController::PermissionsPolicy::ClassMethods # Overrides parts of the globally configured Feature-Policy # header: # # class PagesController < ApplicationController # permissions_policy do |policy| # policy.geolocation "https://example.com" # end # end # # Options can be passed similar to +before_action+. For example, pass # only: :index to override the header on the index action only: # # class PagesController < ApplicationController # permissions_policy(only: :index) do |policy| # policy.camera :self # end # end # # source://actionpack//lib/action_controller/metal/permissions_policy.rb#26 def permissions_policy(**options, &block); end end # source://actionpack//lib/action_controller/railtie.rb#11 class ActionController::Railtie < ::Rails::Railtie; end # source://actionpack//lib/action_controller/railties/helpers.rb#4 module ActionController::Railties; end # source://actionpack//lib/action_controller/railties/helpers.rb#5 module ActionController::Railties::Helpers # source://actionpack//lib/action_controller/railties/helpers.rb#6 def inherited(klass); end end # source://actionpack//lib/action_controller/metal/redirecting.rb#4 module ActionController::Redirecting extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActiveSupport::Benchmarkable include ::AbstractController::Logger include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor include ::ActionController::UrlFor mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods # source://actionpack//lib/action_controller/metal/redirecting.rb#130 def _compute_redirect_to_location(request, options); end # Soft deprecated alias for #redirect_back_or_to where the +fallback_location+ location is supplied as a keyword argument instead # of the first positional argument. # # source://actionpack//lib/action_controller/metal/redirecting.rb#95 def redirect_back(fallback_location:, allow_other_host: T.unsafe(nil), **args); end # Redirects the browser to the page that issued the request (the referrer) # if possible, otherwise redirects to the provided default fallback # location. # # The referrer information is pulled from the HTTP +Referer+ (sic) header on # the request. This is an optional header and its presence on the request is # subject to browser security settings and user preferences. If the request # is missing this header, the fallback_location will be used. # # redirect_back_or_to({ action: "show", id: 5 }) # redirect_back_or_to @post # redirect_back_or_to "http://www.rubyonrails.org" # redirect_back_or_to "/images/screenshot.jpg" # redirect_back_or_to posts_url # redirect_back_or_to proc { edit_post_url(@post) } # redirect_back_or_to '/', allow_other_host: false # # ==== Options # * :allow_other_host - Allow or disallow redirection to the host that is different to the current host, defaults to true. # # All other options that can be passed to #redirect_to are accepted as # options, and the behavior is identical. # # source://actionpack//lib/action_controller/metal/redirecting.rb#121 def redirect_back_or_to(fallback_location, allow_other_host: T.unsafe(nil), **options); end # Redirects the browser to the target specified in +options+. This parameter can be any one of: # # * Hash - The URL will be generated by calling url_for with the +options+. # * Record - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record. # * String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection. # * String not containing a protocol - The current protocol and host is prepended to the string. # * Proc - A block that will be executed in the controller's context. Should return any option accepted by +redirect_to+. # # === Examples: # # redirect_to action: "show", id: 5 # redirect_to @post # redirect_to "http://www.rubyonrails.org" # redirect_to "/images/screenshot.jpg" # redirect_to posts_url # redirect_to proc { edit_post_url(@post) } # # The redirection happens as a 302 Found header unless otherwise specified using the :status option: # # redirect_to post_url(@post), status: :found # redirect_to action: 'atom', status: :moved_permanently # redirect_to post_url(@post), status: 301 # redirect_to action: 'atom', status: 302 # # The status code can either be a standard {HTTP Status code}[https://www.iana.org/assignments/http-status-codes] as an # integer, or a symbol representing the downcased, underscored and symbolized description. # Note that the status code must be a 3xx HTTP code, or redirection will not occur. # # If you are using XHR requests other than GET or POST and redirecting after the # request then some browsers will follow the redirect using the original request # method. This may lead to undesirable behavior such as a double DELETE. To work # around this you can return a 303 See Other status code which will be # followed using a GET request. # # redirect_to posts_url, status: :see_other # redirect_to action: 'index', status: 303 # # It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names # +alert+ and +notice+ as well as a general purpose +flash+ bucket. # # redirect_to post_url(@post), alert: "Watch it, mister!" # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road" # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } # redirect_to({ action: 'atom' }, alert: "Something serious happened") # # Statements after +redirect_to+ in our controller get executed, so +redirect_to+ doesn't stop the execution of the function. # To terminate the execution of the function immediately after the +redirect_to+, use return. # # redirect_to post_url(@post) and return # # === Open Redirect protection # # By default, Rails protects against redirecting to external hosts for your app's safety, so called open redirects. # Note: this was a new default in Rails 7.0, after upgrading opt-in by uncommenting the line with +raise_on_open_redirects+ in config/initializers/new_framework_defaults_7_0.rb # # Here #redirect_to automatically validates the potentially-unsafe URL: # # redirect_to params[:redirect_url] # # Raises UnsafeRedirectError in the case of an unsafe redirect. # # To allow any external redirects pass allow_other_host: true, though using a user-provided param in that case is unsafe. # # redirect_to "https://rubyonrails.org", allow_other_host: true # # See #url_from for more information on what an internal and safe URL is, or how to fall back to an alternate redirect URL in the unsafe case. # # @raise [ActionControllerError] # # source://actionpack//lib/action_controller/metal/redirecting.rb#82 def redirect_to(options = T.unsafe(nil), response_options = T.unsafe(nil)); end # Verifies the passed +location+ is an internal URL that's safe to redirect to and returns it, or nil if not. # Useful to wrap a params provided redirect URL and fallback to an alternate URL to redirect to: # # redirect_to url_from(params[:redirect_url]) || root_url # # The +location+ is considered internal, and safe, if it's on the same host as request.host: # # # If request.host is example.com: # url_from("https://example.com/profile") # => "https://example.com/profile" # url_from("http://example.com/profile") # => "http://example.com/profile" # url_from("http://evil.com/profile") # => nil # # Subdomains are considered part of the host: # # # If request.host is on https://example.com or https://app.example.com, you'd get: # url_from("https://dev.example.com/profile") # => nil # # NOTE: there's a similarity with {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor#url_for], which generates an internal URL from various options from within the app, e.g. url_for(@post). # However, #url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]). # # source://actionpack//lib/action_controller/metal/redirecting.rb#169 def url_from(location); end private # source://actionpack//lib/action_controller/metal/redirecting.rb#175 def _allow_other_host; end # source://actionpack//lib/action_controller/metal/redirecting.rb#189 def _enforce_open_redirect_protection(location, allow_other_host:); end # source://actionpack//lib/action_controller/metal/redirecting.rb#179 def _extract_redirect_to_status(options, response_options); end # @return [Boolean] # # source://actionpack//lib/action_controller/metal/redirecting.rb#197 def _url_host_allowed?(url); end class << self # source://actionpack//lib/action_controller/metal/redirecting.rb#130 def _compute_redirect_to_location(request, options); end end module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # source://actionpack//lib/action_controller/metal/redirecting.rb#10 class ActionController::Redirecting::UnsafeRedirectError < ::StandardError; end # source://actionpack//lib/action_controller/metal/exceptions.rb#14 class ActionController::RenderError < ::ActionController::ActionControllerError; end # ActionController::Renderer allows you to render arbitrary templates # without requirement of being in controller actions. # # You get a concrete renderer class by invoking ActionController::Base#renderer. # For example: # # ApplicationController.renderer # # It allows you to call method #render directly. # # ApplicationController.renderer.render template: '...' # # You can use this shortcut in a controller, instead of the previous example: # # ApplicationController.render template: '...' # # #render allows you to use the same options that you can use when rendering in a controller. # For example: # # FooController.render :action, locals: { ... }, assigns: { ... } # # The template will be rendered in a Rack environment which is accessible through # ActionController::Renderer#env. You can set it up in two ways: # # * by changing renderer defaults, like # # ApplicationController.renderer.defaults # => hash with default Rack environment # # * by initializing an instance of renderer by passing it a custom environment. # # ApplicationController.renderer.new(method: 'post', https: true) # # source://actionpack//lib/action_controller/renderer.rb#36 class ActionController::Renderer # Accepts a custom Rack environment to render templates in. # It will be merged with the default Rack environment defined by # +ActionController::Renderer::DEFAULTS+. # # @return [Renderer] a new instance of Renderer # # source://actionpack//lib/action_controller/renderer.rb#65 def initialize(controller, env, defaults); end # Returns the value of attribute controller. # # source://actionpack//lib/action_controller/renderer.rb#37 def controller; end # Returns the value of attribute defaults. # # source://actionpack//lib/action_controller/renderer.rb#37 def defaults; end # Create a new renderer for the same controller but with a new env. # # source://actionpack//lib/action_controller/renderer.rb#53 def new(env = T.unsafe(nil)); end # Render templates with any options from ActionController::Base#render_to_string. # # The primary options are: # * :partial - See ActionView::PartialRenderer for details. # * :file - Renders an explicit template file. Add :locals to pass in, if so desired. # It shouldn’t be used directly with unsanitized user input due to lack of validation. # * :inline - Renders an ERB template string. # * :plain - Renders provided text and sets the content type as text/plain. # * :html - Renders the provided HTML safe string, otherwise # performs HTML escape on the string first. Sets the content type as text/html. # * :json - Renders the provided hash or object in JSON. You don't # need to call .to_json on the object you want to render. # * :body - Renders provided text and sets content type of text/plain. # # If no options hash is passed or if :update is specified, then: # # If an object responding to +render_in+ is passed, +render_in+ is called on the object, # passing in the current view context. # # Otherwise, a partial is rendered using the second parameter as the locals hash. # # source://actionpack//lib/action_controller/renderer.rb#91 def render(*args); end # Render templates with any options from ActionController::Base#render_to_string. # # The primary options are: # * :partial - See ActionView::PartialRenderer for details. # * :file - Renders an explicit template file. Add :locals to pass in, if so desired. # It shouldn’t be used directly with unsanitized user input due to lack of validation. # * :inline - Renders an ERB template string. # * :plain - Renders provided text and sets the content type as text/plain. # * :html - Renders the provided HTML safe string, otherwise # performs HTML escape on the string first. Sets the content type as text/html. # * :json - Renders the provided hash or object in JSON. You don't # need to call .to_json on the object you want to render. # * :body - Renders provided text and sets content type of text/plain. # # If no options hash is passed or if :update is specified, then: # # If an object responding to +render_in+ is passed, +render_in+ is called on the object, # passing in the current view context. # # Otherwise, a partial is rendered using the second parameter as the locals hash. # # source://actionpack//lib/action_controller/renderer.rb#91 def render_to_string(*args); end # Create a new renderer for the same controller but with new defaults. # # source://actionpack//lib/action_controller/renderer.rb#58 def with_defaults(defaults); end private # source://actionpack//lib/action_controller/renderer.rb#105 def normalize_keys(defaults, env); end # source://actionpack//lib/action_controller/renderer.rb#126 def rack_key_for(key); end # source://actionpack//lib/action_controller/renderer.rb#130 def rack_value_for(key, value); end class << self # Create a new renderer instance for a specific controller class. # # source://actionpack//lib/action_controller/renderer.rb#48 def for(controller, env = T.unsafe(nil), defaults = T.unsafe(nil)); end end end # source://actionpack//lib/action_controller/renderer.rb#39 ActionController::Renderer::DEFAULTS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_controller/renderer.rb#118 ActionController::Renderer::RACK_KEY_TRANSLATION = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_controller/metal/renderers.rb#23 module ActionController::Renderers extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::Renderers::ClassMethods # source://actionpack//lib/action_controller/metal/renderers.rb#144 def _render_to_body_with_renderer(options); end # source://actionpack//lib/action_controller/metal/renderers.rb#170 def _render_with_renderer_js(js, options); end # source://actionpack//lib/action_controller/metal/renderers.rb#155 def _render_with_renderer_json(json, options); end # source://actionpack//lib/action_controller/metal/renderers.rb#175 def _render_with_renderer_xml(xml, options); end # Called by +render+ in AbstractController::Rendering # which sets the return value as the +response_body+. # # If no renderer is found, +super+ returns control to # ActionView::Rendering.render_to_body, if present. # # source://actionpack//lib/action_controller/metal/renderers.rb#140 def render_to_body(options); end class << self # source://actionpack//lib/action_controller/metal/renderers.rb#90 def _render_with_renderer_method_name(key); end # Adds a new renderer to call within controller actions. # A renderer is invoked by passing its name as an option to # AbstractController::Rendering#render. To create a renderer # pass it a name and a block. The block takes two arguments, the first # is the value paired with its key and the second is the remaining # hash of options passed to +render+. # # Create a csv renderer: # # ActionController::Renderers.add :csv do |obj, options| # filename = options[:filename] || 'data' # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s # send_data str, type: Mime[:csv], # disposition: "attachment; filename=#{filename}.csv" # end # # Note that we used Mime[:csv] for the csv mime type as it comes with Rails. # For a custom renderer, you'll need to register a mime type with # Mime::Type.register. # # To use the csv renderer in a controller action: # # def show # @csvable = Csvable.find(params[:id]) # respond_to do |format| # format.html # format.csv { render csv: @csvable, filename: @csvable.name } # end # end # # source://actionpack//lib/action_controller/metal/renderers.rb#74 def add(key, &block); end # This method is the opposite of add method. # # To remove a csv renderer: # # ActionController::Renderers.remove(:csv) # # source://actionpack//lib/action_controller/metal/renderers.rb#84 def remove(key); end end module GeneratedClassMethods def _renderers; end def _renderers=(value); end def _renderers?; end end module GeneratedInstanceMethods def _renderers; end def _renderers=(value); end def _renderers?; end end end # Used in ActionController::Base and ActionController::API to include all # renderers by default. # # source://actionpack//lib/action_controller/metal/renderers.rb#36 module ActionController::Renderers::All extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionController::Renderers mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActionController::Renderers::ClassMethods module GeneratedClassMethods def _renderers; end def _renderers=(value); end def _renderers?; end end module GeneratedInstanceMethods def _renderers; end def _renderers=(value); end def _renderers?; end end end # source://actionpack//lib/action_controller/metal/renderers.rb#94 module ActionController::Renderers::ClassMethods # Adds, by name, a renderer or renderers to the +_renderers+ available # to call within controller actions. # # It is useful when rendering from an ActionController::Metal controller or # otherwise to add an available renderer proc to a specific controller. # # Both ActionController::Base and ActionController::API # include ActionController::Renderers::All, making all renderers # available in the controller. See Renderers::RENDERERS and Renderers.add. # # Since ActionController::Metal controllers cannot render, the controller # must include AbstractController::Rendering, ActionController::Rendering, # and ActionController::Renderers, and have at least one renderer. # # Rather than including ActionController::Renderers::All and including all renderers, # you may specify which renderers to include by passing the renderer name or names to # +use_renderers+. For example, a controller that includes only the :json renderer # (+_render_with_renderer_json+) might look like: # # class MetalRenderingController < ActionController::Metal # include AbstractController::Rendering # include ActionController::Rendering # include ActionController::Renderers # # use_renderers :json # # def show # render json: record # end # end # # You must specify a +use_renderer+, else the +controller.renderer+ and # +controller._renderers+ will be nil, and the action will fail. # # source://actionpack//lib/action_controller/metal/renderers.rb#128 def use_renderer(*args); end # Adds, by name, a renderer or renderers to the +_renderers+ available # to call within controller actions. # # It is useful when rendering from an ActionController::Metal controller or # otherwise to add an available renderer proc to a specific controller. # # Both ActionController::Base and ActionController::API # include ActionController::Renderers::All, making all renderers # available in the controller. See Renderers::RENDERERS and Renderers.add. # # Since ActionController::Metal controllers cannot render, the controller # must include AbstractController::Rendering, ActionController::Rendering, # and ActionController::Renderers, and have at least one renderer. # # Rather than including ActionController::Renderers::All and including all renderers, # you may specify which renderers to include by passing the renderer name or names to # +use_renderers+. For example, a controller that includes only the :json renderer # (+_render_with_renderer_json+) might look like: # # class MetalRenderingController < ActionController::Metal # include AbstractController::Rendering # include ActionController::Rendering # include ActionController::Renderers # # use_renderers :json # # def show # render json: record # end # end # # You must specify a +use_renderer+, else the +controller.renderer+ and # +controller._renderers+ will be nil, and the action will fail. # # source://actionpack//lib/action_controller/metal/renderers.rb#128 def use_renderers(*args); end end # A Set containing renderer names that correspond to available renderer procs. # Default values are :json, :js, :xml. # # source://actionpack//lib/action_controller/metal/renderers.rb#28 ActionController::Renderers::RENDERERS = T.let(T.unsafe(nil), Set) # source://actionpack//lib/action_controller/metal/rendering.rb#4 module ActionController::Rendering extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionController::Rendering::ClassMethods # Check for double render errors and set the content_type after rendering. # # @raise [::AbstractController::DoubleRenderError] # # source://actionpack//lib/action_controller/metal/rendering.rb#28 def render(*args); end # source://actionpack//lib/action_controller/metal/rendering.rb#45 def render_to_body(options = T.unsafe(nil)); end # Override render_to_string because body can now be set to a Rack body. # # source://actionpack//lib/action_controller/metal/rendering.rb#34 def render_to_string(*_arg0); end private # Normalize arguments by catching blocks and setting them on :update. # # source://actionpack//lib/action_controller/metal/rendering.rb#87 def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil), &blk); end # Normalize both text and status options. # # source://actionpack//lib/action_controller/metal/rendering.rb#94 def _normalize_options(options); end # source://actionpack//lib/action_controller/metal/rendering.rb#108 def _normalize_text(options); end # Process controller specific options, as status, content-type and location. # # source://actionpack//lib/action_controller/metal/rendering.rb#117 def _process_options(options); end # source://actionpack//lib/action_controller/metal/rendering.rb#56 def _process_variant(options); end # source://actionpack//lib/action_controller/metal/rendering.rb#62 def _render_in_priorities(options); end # source://actionpack//lib/action_controller/metal/rendering.rb#70 def _set_html_content_type; end # source://actionpack//lib/action_controller/metal/rendering.rb#74 def _set_rendered_content_type(format); end # source://actionpack//lib/action_controller/metal/rendering.rb#80 def _set_vary_header; end # Before processing, set the request formats in current controller formats. # # source://actionpack//lib/action_controller/metal/rendering.rb#51 def process_action(*_arg0); end end # source://actionpack//lib/action_controller/metal/rendering.rb#9 module ActionController::Rendering::ClassMethods # source://actionpack//lib/action_controller/metal/rendering.rb#21 def inherited(klass); end # source://actionpack//lib/action_controller/metal/rendering.rb#11 def render(*_arg0, **_arg1, &_arg2); end # Returns a renderer instance (inherited from ActionController::Renderer) # for the controller. # # source://actionpack//lib/action_controller/metal/rendering.rb#15 def renderer; end # source://actionpack//lib/action_controller/metal/rendering.rb#17 def setup_renderer!; end end # source://actionpack//lib/action_controller/metal/rendering.rb#7 ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY = T.let(T.unsafe(nil), Array) # Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks # by including a token in the rendered HTML for your application. This token is # stored as a random string in the session, to which an attacker does not have # access. When a request reaches your application, \Rails verifies the received # token with the token in the session. All requests are checked except GET requests # as these should be idempotent. Keep in mind that all session-oriented requests # are CSRF protected by default, including JavaScript and HTML requests. # # Since HTML and JavaScript requests are typically made from the browser, we # need to ensure to verify request authenticity for the web browser. We can # use session-oriented authentication for these types of requests, by using # the protect_from_forgery method in our controllers. # # GET requests are not protected since they don't have side effects like writing # to the database and don't leak sensitive information. JavaScript requests are # an exception: a third-party site can use a # # The first two characters (">) are required in case the exception happens # while rendering attributes for a given tag. You can check the real cause # for the exception in your logger. # # == Web server support # # Not all web servers support streaming out-of-the-box. You need to check # the instructions for each of them. # # ==== Unicorn # # Unicorn supports streaming but it needs to be configured. For this, you # need to create a config file as follow: # # # unicorn.config.rb # listen 3000, tcp_nopush: false # # And use it on initialization: # # unicorn_rails --config-file unicorn.config.rb # # You may also want to configure other parameters like :tcp_nodelay. # Please check its documentation for more information: https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-listen # # If you are using Unicorn with NGINX, you may need to tweak NGINX. # Streaming should work out of the box on Rainbows. # # ==== Passenger # # To be described. # # source://actionpack//lib/action_controller/metal/streaming.rb#195 module ActionController::Streaming private # Set proper cache control and transfer encoding when streaming # # source://actionpack//lib/action_controller/metal/streaming.rb#198 def _process_options(options); end # Call render_body if we are streaming instead of usual +render+. # # source://actionpack//lib/action_controller/metal/streaming.rb#212 def _render_template(options); end end # == Strong \Parameters # # It provides an interface for protecting attributes from end-user # assignment. This makes Action Controller parameters forbidden # to be used in Active Model mass assignment until they have been explicitly # enumerated. # # In addition, parameters can be marked as required and flow through a # predefined raise/rescue flow to end up as a 400 Bad Request with no # effort. # # class PeopleController < ActionController::Base # # Using "Person.create(params[:person])" would raise an # # ActiveModel::ForbiddenAttributesError exception because it'd # # be using mass assignment without an explicit permit step. # # This is the recommended form: # def create # Person.create(person_params) # end # # # This will pass with flying colors as long as there's a person key in the # # parameters, otherwise it'll raise an ActionController::ParameterMissing # # exception, which will get caught by ActionController::Base and turned # # into a 400 Bad Request reply. # def update # redirect_to current_account.people.find(params[:id]).tap { |person| # person.update!(person_params) # } # end # # private # # Using a private method to encapsulate the permissible parameters is # # a good pattern since you'll be able to reuse the same permit # # list between create and update. Also, you can specialize this method # # with per-user checking of permissible attributes. # def person_params # params.require(:person).permit(:name, :age) # end # end # # In order to use accepts_nested_attributes_for with Strong \Parameters, you # will need to specify which nested attributes should be permitted. You might want # to allow +:id+ and +:_destroy+, see ActiveRecord::NestedAttributes for more information. # # class Person # has_many :pets # accepts_nested_attributes_for :pets # end # # class PeopleController < ActionController::Base # def create # Person.create(person_params) # end # # ... # # private # # def person_params # # It's mandatory to specify the nested attributes that should be permitted. # # If you use `permit` with just the key that points to the nested attributes hash, # # it will return an empty hash. # params.require(:person).permit(:name, :age, pets_attributes: [ :id, :name, :category ]) # end # end # # See ActionController::Parameters.require and ActionController::Parameters.permit # for more information. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1221 module ActionController::StrongParameters # Returns a new ActionController::Parameters object that # has been instantiated with the request.parameters. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1224 def params; end # Assigns the given +value+ to the +params+ hash. If +value+ # is a Hash, this will create an ActionController::Parameters # object that has been instantiated with the given +value+ hash. # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1239 def params=(value); end end # source://actionpack//lib/action_controller/template_assertions.rb#4 module ActionController::TemplateAssertions # @raise [NoMethodError] # # source://actionpack//lib/action_controller/template_assertions.rb#5 def assert_template(options = T.unsafe(nil), message = T.unsafe(nil)); end end # Superclass for ActionController functional tests. Functional tests allow you to # test a single controller action per test method. # # == Use integration style controller tests over functional style controller tests. # # Rails discourages the use of functional tests in favor of integration tests # (use ActionDispatch::IntegrationTest). # # New Rails applications no longer generate functional style controller tests and they should # only be used for backward compatibility. Integration style controller tests perform actual # requests, whereas functional style controller tests merely simulate a request. Besides, # integration tests are as fast as functional tests and provide lot of helpers such as +as+, # +parsed_body+ for effective testing of controller actions including even API endpoints. # # == Basic example # # Functional tests are written as follows: # 1. First, one uses the +get+, +post+, +patch+, +put+, +delete+, or +head+ method to simulate # an HTTP request. # 2. Then, one asserts whether the current state is as expected. "State" can be anything: # the controller's HTTP response, the database contents, etc. # # For example: # # class BooksControllerTest < ActionController::TestCase # def test_create # # Simulate a POST response with the given HTTP parameters. # post(:create, params: { book: { title: "Love Hina" }}) # # # Asserts that the controller tried to redirect us to # # the created book's URI. # assert_response :found # # # Asserts that the controller really put the book in the database. # assert_not_nil Book.find_by(title: "Love Hina") # end # end # # You can also send a real document in the simulated HTTP request. # # def test_create # json = {book: { title: "Love Hina" }}.to_json # post :create, body: json # end # # == Special instance variables # # ActionController::TestCase will also automatically provide the following instance # variables for use in the tests: # # @controller:: # The controller instance that will be tested. # @request:: # An ActionController::TestRequest, representing the current HTTP # request. You can modify this object before sending the HTTP request. For example, # you might want to set some session properties before sending a GET request. # @response:: # An ActionDispatch::TestResponse object, representing the response # of the last HTTP response. In the above example, @response becomes valid # after calling +post+. If the various assert methods are not sufficient, then you # may use this object to inspect the HTTP response in detail. # # == Controller is automatically inferred # # ActionController::TestCase will automatically infer the controller under test # from the test class name. If the controller cannot be inferred from the test # class name, you can explicitly set it with +tests+. # # class SpecialEdgeCaseWidgetsControllerTest < ActionController::TestCase # tests WidgetController # end # # == \Testing controller internals # # In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions # can be used against. These collections are: # # * session: Objects being saved in the session. # * flash: The flash objects currently in the session. # * cookies: \Cookies being sent to the user on this request. # # These collections can be used just like any other hash: # # assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" # assert flash.empty? # makes sure that there's nothing in the flash # # On top of the collections, you have the complete URL that a given action redirected to available in redirect_to_url. # # For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another # action call which can then be asserted against. # # == Manipulating session and cookie variables # # Sometimes you need to set up the session and cookie variables for a test. # To do this just assign a value to the session or cookie collection: # # session[:key] = "value" # cookies[:key] = "value" # # To clear the cookies for a test just clear the cookie collection: # # cookies.clear # # == \Testing named routes # # If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case. # # assert_redirected_to page_url(title: 'foo') # # source://actionpack//lib/action_controller/test_case.rb#335 class ActionController::TestCase < ::ActiveSupport::TestCase include ::ActiveSupport::Testing::ConstantLookup include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions include ::ActionDispatch::TestProcess::FixtureFile include ::ActionDispatch::TestProcess include ::ActionController::TestCase::Behavior include ::ActionController::TemplateAssertions include ::ActionDispatch::Assertions extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods extend ::ActionController::TestCase::Behavior::ClassMethods # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class; end # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class=(_arg0); end # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class?; end class << self # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class; end # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class=(value); end # source://actionpack//lib/action_controller/test_case.rb#561 def _controller_class?; end # source://actionpack//lib/action_controller/test_case.rb#336 def executor_around_each_request; end # source://actionpack//lib/action_controller/test_case.rb#336 def executor_around_each_request=(_arg0); end end end # source://actionpack//lib/action_controller/test_case.rb#338 module ActionController::TestCase::Behavior include ::ActionDispatch::TestProcess::FixtureFile include ::ActionDispatch::TestProcess extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActiveSupport::Testing::ConstantLookup include ::Rails::Dom::Testing::Assertions include ::ActionController::TemplateAssertions include ::ActionDispatch::Assertions mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods mixes_in_class_methods ::ActionController::TestCase::Behavior::ClassMethods # source://actionpack//lib/action_controller/test_case.rb#554 def build_response(klass); end # source://actionpack//lib/action_controller/test_case.rb#514 def controller_class_name; end # Simulate a DELETE request with the given parameters and set/volley the response. # See +get+ for more details. # # source://actionpack//lib/action_controller/test_case.rb#429 def delete(action, **args); end # source://actionpack//lib/action_controller/test_case.rb#518 def generated_path(generated_extras); end # Simulate a GET request with the given parameters. # # - +action+: The controller action to call. # - +params+: The hash with HTTP parameters that you want to pass. This may be +nil+. # - +body+: The request body with a string that is appropriately encoded # (application/x-www-form-urlencoded or multipart/form-data). # - +session+: A hash of parameters to store in the session. This may be +nil+. # - +flash+: A hash of parameters to store in the flash. This may be +nil+. # # You can also simulate POST, PATCH, PUT, DELETE, and HEAD requests with # +post+, +patch+, +put+, +delete+, and +head+. # Example sending parameters, session, and setting a flash message: # # get :show, # params: { id: 7 }, # session: { user_id: 1 }, # flash: { notice: 'This is flash message' } # # Note that the request method is not verified. The different methods are # available to make the tests more expressive. # # source://actionpack//lib/action_controller/test_case.rb#403 def get(action, **args); end # Simulate a HEAD request with the given parameters and set/volley the response. # See +get+ for more details. # # source://actionpack//lib/action_controller/test_case.rb#435 def head(action, **args); end # Simulate a PATCH request with the given parameters and set/volley the response. # See +get+ for more details. # # source://actionpack//lib/action_controller/test_case.rb#417 def patch(action, **args); end # Simulate a POST request with the given parameters and set/volley the response. # See +get+ for more details. # # source://actionpack//lib/action_controller/test_case.rb#411 def post(action, **args); end # Simulate an HTTP request to +action+ by specifying request method, # parameters and set/volley the response. # # - +action+: The controller action to call. # - +method+: Request method used to send the HTTP request. Possible values # are +GET+, +POST+, +PATCH+, +PUT+, +DELETE+, +HEAD+. Defaults to +GET+. Can be a symbol. # - +params+: The hash with HTTP parameters that you want to pass. This may be +nil+. # - +body+: The request body with a string that is appropriately encoded # (application/x-www-form-urlencoded or multipart/form-data). # - +session+: A hash of parameters to store in the session. This may be +nil+. # - +flash+: A hash of parameters to store in the flash. This may be +nil+. # - +format+: Request format. Defaults to +nil+. Can be string or symbol. # - +as+: Content type. Defaults to +nil+. Must be a symbol that corresponds # to a mime type. # # Example calling +create+ action and sending two params: # # process :create, # method: 'POST', # params: { # user: { name: 'Gaurish Sharma', email: 'user@example.com' } # }, # session: { user_id: 1 }, # flash: { notice: 'This is flash message' } # # To simulate +GET+, +POST+, +PATCH+, +PUT+, +DELETE+, and +HEAD+ requests # prefer using #get, #post, #patch, #put, #delete and #head methods # respectively which will make tests more expressive. # # It's not recommended to make more than one request in the same test. Instance # variables that are set in one request will not persist to the next request, # but it's not guaranteed that all Rails internal state will be reset. Prefer # ActionDispatch::IntegrationTest for making multiple requests in the same test. # # Note that the request method is not verified. # # source://actionpack//lib/action_controller/test_case.rb#474 def process(action, method: T.unsafe(nil), params: T.unsafe(nil), session: T.unsafe(nil), body: T.unsafe(nil), flash: T.unsafe(nil), format: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end # Simulate a PUT request with the given parameters and set/volley the response. # See +get+ for more details. # # source://actionpack//lib/action_controller/test_case.rb#423 def put(action, **args); end # source://actionpack//lib/action_controller/test_case.rb#522 def query_parameter_names(generated_extras); end # Returns the value of attribute request. # # source://actionpack//lib/action_controller/test_case.rb#344 def request; end # Returns the value of attribute response. # # source://actionpack//lib/action_controller/test_case.rb#344 def response; end # source://actionpack//lib/action_controller/test_case.rb#526 def setup_controller_request_and_response; end private # source://actionpack//lib/action_controller/test_case.rb#646 def check_required_ivars; end # source://actionpack//lib/action_controller/test_case.rb#642 def document_root_element; end # source://actionpack//lib/action_controller/test_case.rb#597 def process_controller_response(action, cookies, xhr); end # source://actionpack//lib/action_controller/test_case.rb#632 def scrub_env!(env); end # source://actionpack//lib/action_controller/test_case.rb#567 def setup_request(controller_class_name, action, parameters, session, flash, xhr); end # source://actionpack//lib/action_controller/test_case.rb#589 def wrap_execution(&block); end module GeneratedClassMethods def _controller_class; end def _controller_class=(value); end def _controller_class?; end end module GeneratedInstanceMethods def _controller_class; end def _controller_class=(value); end def _controller_class?; end end end # source://actionpack//lib/action_controller/test_case.rb#346 module ActionController::TestCase::Behavior::ClassMethods # source://actionpack//lib/action_controller/test_case.rb#368 def controller_class; end # source://actionpack//lib/action_controller/test_case.rb#364 def controller_class=(new_class); end # source://actionpack//lib/action_controller/test_case.rb#376 def determine_default_controller_class(name); end # Sets the controller class name. Useful if the name can't be inferred from test class. # Normalizes +controller_class+ before using. # # tests WidgetController # tests :widget # tests 'widget' # # source://actionpack//lib/action_controller/test_case.rb#353 def tests(controller_class); end end # ActionController::TestCase will be deprecated and moved to a gem in the future. # Please use ActionDispatch::IntegrationTest going forward. # # source://actionpack//lib/action_controller/test_case.rb#34 class ActionController::TestRequest < ::ActionDispatch::TestRequest # @return [TestRequest] a new instance of TestRequest # # source://actionpack//lib/action_controller/test_case.rb#57 def initialize(env, session, controller_class); end # source://actionpack//lib/action_controller/test_case.rb#76 def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end # source://actionpack//lib/action_controller/test_case.rb#72 def content_type=(type); end # Returns the value of attribute controller_class. # # source://actionpack//lib/action_controller/test_case.rb#42 def controller_class; end # source://actionpack//lib/action_controller/test_case.rb#68 def query_string=(string); end private # source://actionpack//lib/action_controller/test_case.rb#164 def params_parsers; end class << self # Create a new test request with default `env` values. # # source://actionpack//lib/action_controller/test_case.rb#45 def create(controller_class); end # source://actionpack//lib/action_controller/test_case.rb#38 def new_session; end private # source://actionpack//lib/action_controller/test_case.rb#52 def default_env; end end end # source://actionpack//lib/action_controller/test_case.rb#35 ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_controller/test_case.rb#136 ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) # Methods #destroy and #load! are overridden to avoid calling methods on the # # source://actionpack//lib/action_controller/test_case.rb#182 class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash # @return [TestSession] a new instance of TestSession # # source://actionpack//lib/action_controller/test_case.rb#185 def initialize(session = T.unsafe(nil)); end # source://actionpack//lib/action_controller/test_case.rb#204 def destroy; end # source://actionpack//lib/action_controller/test_case.rb#208 def dig(*keys); end # @return [Boolean] # # source://actionpack//lib/action_controller/test_case.rb#217 def enabled?; end # @return [Boolean] # # source://actionpack//lib/action_controller/test_case.rb#192 def exists?; end # source://actionpack//lib/action_controller/test_case.rb#213 def fetch(key, *args, &block); end # source://actionpack//lib/action_controller/test_case.rb#196 def keys; end # source://actionpack//lib/action_controller/test_case.rb#200 def values; end private # source://actionpack//lib/action_controller/test_case.rb#222 def load!; end end # source://actionpack//lib/action_controller/test_case.rb#183 ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_controller/metal/testing.rb#4 module ActionController::Testing; end # Behavior specific to functional tests # # source://actionpack//lib/action_controller/metal/testing.rb#6 module ActionController::Testing::Functional # source://actionpack//lib/action_controller/metal/testing.rb#7 def clear_instance_variables_between_requests; end # source://actionpack//lib/action_controller/metal/testing.rb#16 def recycle!; end end # Raised when a Parameters instance is not marked as permitted and # an operation to transform it to hash is called. # # params = ActionController::Parameters.new(a: "123", b: "456") # params.to_h # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#61 class ActionController::UnfilteredParameters < ::ArgumentError # @return [UnfilteredParameters] a new instance of UnfilteredParameters # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#62 def initialize; end end # source://actionpack//lib/action_controller/metal/exceptions.rb#73 class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end # source://actionpack//lib/action_controller/metal/exceptions.rb#70 class ActionController::UnknownHttpMethod < ::ActionController::ActionControllerError; end # Raised when a supplied parameter is not expected and # ActionController::Parameters.action_on_unpermitted_parameters # is set to :raise. # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#46 class ActionController::UnpermittedParameters < ::IndexError # @return [UnpermittedParameters] a new instance of UnpermittedParameters # # source://actionpack//lib/action_controller/metal/strong_parameters.rb#49 def initialize(params); end # source://actionpack//lib/action_controller/metal/strong_parameters.rb#47 def params; end end # Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing # the _routes method. Otherwise, an exception will be raised. # # In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define # URL options like the +host+. In order to do so, this module requires the host class # to implement +env+ which needs to be Rack-compatible and +request+ # which is either an instance of ActionDispatch::Request or an object # that responds to the +host+, +optional_port+, +protocol+, and # +symbolized_path_parameter+ methods. # # class RootUrl # include ActionController::UrlFor # include Rails.application.routes.url_helpers # # delegate :env, :request, to: :controller # # def initialize(controller) # @controller = controller # @url = root_path # named route from the application. # end # end # # source://actionpack//lib/action_controller/metal/url_for.rb#25 module ActionController::UrlFor extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionDispatch::Routing::UrlFor include ::AbstractController::UrlFor mixes_in_class_methods GeneratedClassMethods mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods # source://actionpack//lib/action_controller/metal/url_for.rb#30 def url_options; end module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # source://actionpack//lib/action_controller/metal/exceptions.rb#25 class ActionController::UrlGenerationError < ::ActionController::ActionControllerError include ::DidYouMean::Correctable # @return [UrlGenerationError] a new instance of UrlGenerationError # # source://actionpack//lib/action_controller/metal/exceptions.rb#28 def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end # source://actionpack//lib/action_controller/metal/exceptions.rb#39 def corrections; end # Returns the value of attribute method_name. # # source://actionpack//lib/action_controller/metal/exceptions.rb#26 def method_name; end # Returns the value of attribute route_name. # # source://actionpack//lib/action_controller/metal/exceptions.rb#26 def route_name; end # Returns the value of attribute routes. # # source://actionpack//lib/action_controller/metal/exceptions.rb#26 def routes; end end # source://actionpack//lib/action_dispatch.rb#37 module ActionDispatch extend ::ActiveSupport::Autoload # source://actionpack//lib/action_dispatch.rb#99 def test_app; end # source://actionpack//lib/action_dispatch.rb#99 def test_app=(val); end class << self # source://actionpack//lib/action_dispatch.rb#99 def test_app; end # source://actionpack//lib/action_dispatch.rb#99 def test_app=(val); end end end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#8 class ActionDispatch::ActionableExceptions # @return [ActionableExceptions] a new instance of ActionableExceptions # # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#11 def initialize(app); end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#15 def call(env); end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 def endpoint; end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 def endpoint=(val); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#25 def actionable_request?(request); end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#29 def redirect_to(location); end class << self # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 def endpoint; end # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 def endpoint=(val); end end end # This is a class that abstracts away an asserted response. It purposely # does not inherit from Response because it doesn't need it. That means it # does not have headers or a body. # # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#7 class ActionDispatch::AssertionResponse # Accepts a specific response status code as an Integer (404) or String # ('404') or a response status range as a Symbol pseudo-code (:success, # indicating any 200-299 status code). # # @raise [ArgumentError] # @return [AssertionResponse] a new instance of AssertionResponse # # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#20 def initialize(code_or_name); end # Returns the value of attribute code. # # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#8 def code; end # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#33 def code_and_name; end # Returns the value of attribute name. # # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#8 def name; end private # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#38 def code_from_name(name); end # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#42 def name_from_code(code); end end # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#4 module ActionDispatch::Assertions include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions # source://actionpack//lib/action_dispatch/testing/assertions.rb#13 def html_document; end end # A small suite of assertions that test responses from \Rails applications. # # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#6 module ActionDispatch::Assertions::ResponseAssertions # Asserts that the response is a redirect to a URL matching the given options. # # # Asserts that the redirection was to the "index" action on the WeblogController # assert_redirected_to controller: "weblog", action: "index" # # # Asserts that the redirection was to the named route login_url # assert_redirected_to login_url # # # Asserts that the redirection was to the URL for @customer # assert_redirected_to @customer # # # Asserts that the redirection matches the regular expression # assert_redirected_to %r(\Ahttp://example.org) # # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#53 def assert_redirected_to(options = T.unsafe(nil), message = T.unsafe(nil)); end # Asserts that the response is one of the following types: # # * :success - Status code was in the 200-299 range # * :redirect - Status code was in the 300-399 range # * :missing - Status code was 404 # * :error - Status code was in the 500-599 range # # You can also pass an explicit status number like assert_response(501) # or its symbolic equivalent assert_response(:not_implemented). # See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list. # # # Asserts that the response was a redirection # assert_response :redirect # # # Asserts that the response code was status code 401 (unauthorized) # assert_response 401 # # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#30 def assert_response(type, message = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#95 def code_with_name(code_or_name); end # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#79 def generate_response_message(expected, actual = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#89 def location_if_redirected; end # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#70 def normalize_argument_to_redirection(fragment); end # Proxy to to_param if the object will respond to it. # # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#66 def parameterize(value); end # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#84 def response_body_if_short; end end # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#7 ActionDispatch::Assertions::ResponseAssertions::RESPONSE_PREDICATES = T.let(T.unsafe(nil), Hash) # Suite of assertions to test routes generated by \Rails and the handling of requests made to them. # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#11 module ActionDispatch::Assertions::RoutingAssertions # Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+. # The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in # a query string. The +message+ parameter allows you to specify a custom error message for assertion failures. # # The +defaults+ parameter is unused. # # # Asserts that the default action is generated for a route with no action # assert_generates "/items", controller: "items", action: "index" # # # Tests that the list action is properly routed # assert_generates "/items/list", controller: "items", action: "list" # # # Tests the generation of a route with a parameter # assert_generates "/items/list/1", { controller: "items", action: "list", id: "1" } # # # Asserts that the generated route gives us our custom route # assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" } # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#85 def assert_generates(expected_path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end # Asserts that the routing of the given +path+ was handled correctly and that the parsed options (given in the +expected_options+ hash) # match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+. # # Pass a hash in the second argument (+path+) to specify the request method. This is useful for routes # requiring a specific HTTP method. The hash should contain a +:path+ with the incoming request path # and a +:method+ containing the required HTTP verb. # # # Asserts that POSTing to /items will call the create action on ItemsController # assert_recognizes({controller: 'items', action: 'create'}, {path: 'items', method: :post}) # # You can also pass in +extras+ with a hash containing URL parameters that would normally be in the query string. This can be used # to assert that values in the query string will end up in the params hash correctly. To test query strings you must use the extras # argument because appending the query string on the path directly will not work. For example: # # # Asserts that a path of '/items/list/1?view=print' returns the correct options # assert_recognizes({controller: 'items', action: 'list', id: '1', view: 'print'}, 'items/list/1', { view: "print" }) # # The +message+ parameter allows you to pass in an error message that is displayed upon failure. # # # Check the default route (i.e., the index action) # assert_recognizes({controller: 'items', action: 'index'}, 'items') # # # Test a specific action # assert_recognizes({controller: 'items', action: 'list'}, 'items/list') # # # Test an action with a parameter # assert_recognizes({controller: 'items', action: 'destroy', id: '1'}, 'items/destroy/1') # # # Test a custom route # assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1') # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#47 def assert_recognizes(expected_options, path, extras = T.unsafe(nil), msg = T.unsafe(nil)); end # Asserts that path and options match both ways; in other words, it verifies that path generates # options and then that options generates path. This essentially combines +assert_recognizes+ # and +assert_generates+ into one step. # # The +extras+ hash allows you to specify options that would normally be provided as a query string to the action. The # +message+ parameter allows you to specify a custom error message to display upon failure. # # # Asserts a basic route: a controller with the default action (index) # assert_routing '/home', controller: 'home', action: 'index' # # # Test a route generated with a specific controller, action, and parameter (id) # assert_routing '/entries/show/23', controller: 'entries', action: 'show', id: 23 # # # Asserts a basic route (controller + default action), with an error message if it fails # assert_routing '/store', { controller: 'store', action: 'index' }, {}, {}, 'Route for store index not generated properly' # # # Tests a route, providing a defaults hash # assert_routing 'controller/action/9', {id: "9", item: "square"}, {controller: "controller", action: "action"}, {}, {item: "square"} # # # Tests a route with an HTTP method # assert_routing({ method: 'put', path: '/product/321' }, { controller: "product", action: "update", id: "321" }) # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#128 def assert_routing(path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end # ROUTES TODO: These assertions should really work in an integration context # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#183 def method_missing(selector, *args, **_arg2, &block); end # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#12 def setup; end # A helper to make it easier to test different route configurations. # This method temporarily replaces @routes with a new RouteSet instance. # # The new instance is yielded to the passed block. Typically the block # will create some routes using set.draw { match ... }: # # with_routing do |set| # set.draw do # resources :users # end # assert_equal "/users", users_path # end # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#153 def with_routing; end private # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#228 def fail_on(exception_class, message); end # Recognizes the route for a given path. # # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#194 def recognized_request_for(path, extras = T.unsafe(nil), msg); end end # Provides callbacks to be executed before and after dispatching the request. # # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#5 class ActionDispatch::Callbacks include ::ActiveSupport::Callbacks extend ::ActiveSupport::Callbacks::ClassMethods extend ::ActiveSupport::DescendantsTracker # @return [Callbacks] a new instance of Callbacks # # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#20 def initialize(app); end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#940 def _call_callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#928 def _run_call_callbacks(&block); end # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#24 def call(env); end class << self # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks=(value); end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 def __callbacks?; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#932 def _call_callbacks; end # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#936 def _call_callbacks=(value); end # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#15 def after(*args, &block); end # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#11 def before(*args, &block); end end end # Configures the HTTP # {Content-Security-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy] # response header to help protect against XSS and injection attacks. # # Example global policy: # # Rails.application.config.content_security_policy do |policy| # policy.default_src :self, :https # policy.font_src :self, :https, :data # policy.img_src :self, :https, :data # policy.object_src :none # policy.script_src :self, :https # policy.style_src :self, :https # # # Specify URI for violation reports # policy.report_uri "/csp-violation-report-endpoint" # end # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#24 class ActionDispatch::ContentSecurityPolicy # @return [ContentSecurityPolicy] a new instance of ContentSecurityPolicy # @yield [_self] # @yieldparam _self [ActionDispatch::ContentSecurityPolicy] the object that the method was called on # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#169 def initialize; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def base_uri(*sources); end # Specify whether to prevent the user agent from loading any assets over # HTTP when the page uses HTTPS: # # policy.block_all_mixed_content # # Pass +false+ to allow it again: # # policy.block_all_mixed_content false # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#197 def block_all_mixed_content(enabled = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#286 def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def child_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def connect_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def default_src(*sources); end # Returns the value of attribute directives. # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#167 def directives; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def font_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def form_action(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def frame_ancestors(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def frame_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def img_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def manifest_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def media_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def object_src(*sources); end # Restricts the set of plugins that can be embedded: # # policy.plugin_types "application/x-shockwave-flash" # # Leave empty to allow all plugins: # # policy.plugin_types # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#213 def plugin_types(*types); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def prefetch_src(*sources); end # Enable the {report-uri}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri] # directive. Violation reports will be sent to the specified URI: # # policy.report_uri "/csp-violation-report-endpoint" # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#226 def report_uri(uri); end # Specify asset types for which {Subresource Integrity}[https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity] # is required: # # policy.require_sri_for :script, :style # # Leave empty to not require Subresource Integrity: # # policy.require_sri_for # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#239 def require_sri_for(*types); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def require_trusted_types_for(*sources); end # Specify whether a {sandbox}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox] # should be enabled for the requested resource: # # policy.sandbox # # Values can be passed as arguments: # # policy.sandbox "allow-scripts", "allow-modals" # # Pass +false+ to disable the sandbox: # # policy.sandbox false # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#260 def sandbox(*values); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def script_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def script_src_attr(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def script_src_elem(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def style_src(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def style_src_attr(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def style_src_elem(*sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def trusted_types(*sources); end # Specify whether user agents should treat any assets over HTTP as HTTPS: # # policy.upgrade_insecure_requests # # Pass +false+ to disable it: # # policy.upgrade_insecure_requests false # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#278 def upgrade_insecure_requests(enabled = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 def worker_src(*sources); end private # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#305 def apply_mapping(source); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#292 def apply_mappings(sources); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#327 def build_directive(sources, context); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#311 def build_directives(context, nonce, nonce_directives); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#174 def initialize_copy(other); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#349 def nonce_directive?(directive, nonce_directives); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#331 def resolve_source(source, context); end end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#163 ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#138 ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#119 ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#25 class ActionDispatch::ContentSecurityPolicy::Middleware # @return [Middleware] a new instance of Middleware # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#30 def initialize(app); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#34 def call(env); end private # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#51 def header_name(request); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#59 def policy_present?(headers); end end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#26 ActionDispatch::ContentSecurityPolicy::Middleware::CONTENT_TYPE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#27 ActionDispatch::ContentSecurityPolicy::Middleware::POLICY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#28 ActionDispatch::ContentSecurityPolicy::Middleware::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#64 module ActionDispatch::ContentSecurityPolicy::Request # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#71 def content_security_policy; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#75 def content_security_policy=(policy); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#103 def content_security_policy_nonce; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#95 def content_security_policy_nonce_directives; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#99 def content_security_policy_nonce_directives=(generator); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#87 def content_security_policy_nonce_generator; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#91 def content_security_policy_nonce_generator=(generator); end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#79 def content_security_policy_report_only; end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#83 def content_security_policy_report_only=(value); end private # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#114 def generate_content_security_policy_nonce; end end # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#68 ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#69 ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#67 ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#65 ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#66 ActionDispatch::ContentSecurityPolicy::Request::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) # Read and write data to cookies through ActionController::Base#cookies. # # When reading cookie data, the data is read from the HTTP request header, Cookie. # When writing cookie data, the data is sent out in the HTTP response header, Set-Cookie. # # Examples of writing: # # # Sets a simple session cookie. # # This cookie will be deleted when the user's browser is closed. # cookies[:user_name] = "david" # # # Cookie values are String-based. Other data types need to be serialized. # cookies[:lat_lon] = JSON.generate([47.68, -122.37]) # # # Sets a cookie that expires in 1 hour. # cookies[:login] = { value: "XJ-122", expires: 1.hour } # # # Sets a cookie that expires at a specific time. # cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } # # # Sets a signed cookie, which prevents users from tampering with its value. # # It can be read using the signed method `cookies.signed[:name]` # cookies.signed[:user_id] = current_user.id # # # Sets an encrypted cookie value before sending it to the client which # # prevent users from reading and tampering with its value. # # It can be read using the encrypted method `cookies.encrypted[:name]` # cookies.encrypted[:discount] = 45 # # # Sets a "permanent" cookie (which expires in 20 years from now). # cookies.permanent[:login] = "XJ-122" # # # You can also chain these methods: # cookies.signed.permanent[:login] = "XJ-122" # # Examples of reading: # # cookies[:user_name] # => "david" # cookies.size # => 2 # JSON.parse(cookies[:lat_lon]) # => [47.68, -122.37] # cookies.signed[:login] # => "XJ-122" # cookies.encrypted[:discount] # => 45 # # Example for deleting: # # cookies.delete :user_name # # Please note that if you specify a +:domain+ when setting a cookie, you must also specify the domain when deleting the cookie: # # cookies[:name] = { # value: 'a yummy cookie', # expires: 1.year, # domain: 'domain.com' # } # # cookies.delete(:name, domain: 'domain.com') # # The option symbols for setting cookies are: # # * :value - The cookie's value. # * :path - The path for which this cookie applies. Defaults to the root # of the application. # * :domain - The domain for which this cookie applies so you can # restrict to the domain level. If you use a schema like www.example.com # and want to share session with user.example.com set :domain # to :all. To support multiple domains, provide an array, and # the first domain matching request.host will be used. Make # sure to specify the :domain option with :all or # Array again when deleting cookies. # # domain: nil # Does not set cookie domain. (default) # domain: :all # Allow the cookie for the top most level # # domain and subdomains. # domain: %w(.example.com .example.org) # Allow the cookie # # for concrete domain names. # # * :tld_length - When using :domain => :all, this option can be used to explicitly # set the TLD length when using a short (<= 3 character) domain that is being interpreted as part of a TLD. # For example, to share cookies between user1.lvh.me and user2.lvh.me, set :tld_length to 2. # * :expires - The time at which this cookie expires, as a \Time or ActiveSupport::Duration object. # * :secure - Whether this cookie is only transmitted to HTTPS servers. # Default is +false+. # * :httponly - Whether this cookie is accessible via scripting or # only HTTP. Defaults to +false+. # * :same_site - The value of the +SameSite+ cookie attribute, which # determines how this cookie should be restricted in cross-site contexts. # Possible values are +:none+, +:lax+, and +:strict+. Defaults to +:lax+. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#182 class ActionDispatch::Cookies # @return [Cookies] a new instance of Cookies # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#697 def initialize(app); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#701 def call(env); end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#188 ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#485 class ActionDispatch::Cookies::AbstractCookieJar include ::ActionDispatch::Cookies::ChainedCookieJars # @return [AbstractCookieJar] a new instance of AbstractCookieJar # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#488 def initialize(parent_jar); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#492 def [](name); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#504 def []=(name, options); end protected # source://actionpack//lib/action_dispatch/middleware/cookies.rb#516 def request; end private # source://actionpack//lib/action_dispatch/middleware/cookies.rb#534 def commit(name, options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#527 def cookie_metadata(name, options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#519 def expiry_options(options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#533 def parse(name, data, purpose: T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#194 ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#195 ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#196 ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#193 ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) # Include in a cookie jar to allow chaining, e.g. +cookies.permanent.signed+. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#206 module ActionDispatch::Cookies::ChainedCookieJars # Returns a jar that'll automatically encrypt cookie values before sending them to the client and will decrypt them for read. # If the cookie was tampered with by the user (or a 3rd party), +nil+ will be returned. # # If +config.action_dispatch.encrypted_cookie_salt+ and +config.action_dispatch.encrypted_signed_cookie_salt+ # are both set, legacy cookies encrypted with HMAC AES-256-CBC will be transparently upgraded. # # This jar requires that you set a suitable secret for the verification on your app's +secret_key_base+. # # Example: # # cookies.encrypted[:discount] = 45 # # => Set-Cookie: discount=DIQ7fw==--K3n//8vvnSbGq9dA--7Xh91HfLpwzbj1czhBiwOg==; path=/ # # cookies.encrypted[:discount] # => 45 # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#252 def encrypted; end # Returns a jar that'll automatically set the assigned cookies to have an expiration date 20 years from now. Example: # # cookies.permanent[:prefers_open_id] = true # # => Set-Cookie: prefers_open_id=true; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT # # This jar is only meant for writing. You'll read permanent cookies through the regular accessor. # # This jar allows chaining with the signed jar as well, so you can set permanent, signed cookies. Examples: # # cookies.permanent.signed[:remember_me] = current_user.id # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#218 def permanent; end # Returns a jar that'll automatically generate a signed representation of cookie value and verify it when reading from # the cookie again. This is useful for creating cookies with values that the user is not supposed to change. If a signed # cookie was tampered with by the user (or a 3rd party), +nil+ will be returned. # # This jar requires that you set a suitable secret for the verification on your app's +secret_key_base+. # # Example: # # cookies.signed[:discount] = 45 # # => Set-Cookie: discount=BAhpMg==--2c1c6906c90a3bc4fd54a51ffb41dffa4bf6b5f7; path=/ # # cookies.signed[:discount] # => 45 # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#234 def signed; end # Returns the +signed+ or +encrypted+ jar, preferring +encrypted+ if +secret_key_base+ is set. # Used by ActionDispatch::Session::CookieStore to avoid the need to introduce new cookie stores. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#258 def signed_or_encrypted; end private # source://actionpack//lib/action_dispatch/middleware/cookies.rb#281 def encrypted_cookie_cipher; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#275 def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#285 def signed_cookie_digest; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#268 def upgrade_legacy_hmac_aes_cbc_cookies?; end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#290 class ActionDispatch::Cookies::CookieJar include ::ActionDispatch::Cookies::ChainedCookieJars include ::Enumerable # @return [CookieJar] a new instance of CookieJar # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#301 def initialize(request); end # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#322 def [](name); end # Sets the cookie named +name+. The second argument may be the cookie's # value or a hash of options as documented above. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#356 def []=(name, options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#410 def always_write_cookie; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#410 def always_write_cookie=(val); end # Removes all cookies on the client machine by calling delete for each cookie. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#400 def clear(options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#311 def commit!; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#309 def committed?; end # Removes the cookie on the client machine by setting the value to an empty string # and the expiration date in the past. Like []=, you can pass in # an options hash to delete cookies with extra data such as a :path. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#379 def delete(name, options = T.unsafe(nil)); end # Whether the given cookie is to be deleted by this CookieJar. # Like []=, you can pass in an options hash to test if a # deletion applies to a specific :path, :domain etc. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#393 def deleted?(name, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#317 def each(&block); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#326 def fetch(name, *args, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#330 def has_key?(name); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#330 def key?(name); end # Returns the value of attribute request. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#299 def request; end # Returns the cookies as Hash. def to_hash(*_arg0); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#350 def to_header; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#338 def update(other_hash); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#343 def update_cookies_from_jar; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#404 def write(headers); end private # source://actionpack//lib/action_dispatch/middleware/cookies.rb#413 def escape(string); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#434 def handle_options(options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#417 def make_set_cookie_header(header); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#430 def write_cookie?(cookie); end class << self # source://actionpack//lib/action_dispatch/middleware/cookies.rb#410 def always_write_cookie; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#410 def always_write_cookie=(val); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#293 def build(req, cookies); end end end # Raised when storing more than 4K of session data. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#203 class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#190 ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#186 ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#187 ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#645 class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar include ::ActionDispatch::Cookies::SerializedCookieJars # @return [EncryptedKeyRotatingCookieJar] a new instance of EncryptedKeyRotatingCookieJar # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#648 def initialize(parent_jar); end private # @raise [CookieOverflow] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#690 def commit(name, options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#682 def parse(name, encrypted_message, purpose: T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#184 ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#183 ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#556 class ActionDispatch::Cookies::JsonSerializer class << self # source://actionpack//lib/action_dispatch/middleware/cookies.rb#561 def dump(value); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#557 def load(value); end end end # Cookies can typically store 4096 bytes. # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#200 ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#544 class ActionDispatch::Cookies::MarshalWithJsonFallback class << self # source://actionpack//lib/action_dispatch/middleware/cookies.rb#551 def dump(value); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#545 def load(value); end end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#537 class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar private # source://actionpack//lib/action_dispatch/middleware/cookies.rb#539 def commit(name, options); end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#192 ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#191 ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#185 ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#566 module ActionDispatch::Cookies::SerializedCookieJars protected # source://actionpack//lib/action_dispatch/middleware/cookies.rb#579 def deserialize(name); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#611 def digest; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#571 def needs_migration?(value); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#575 def serialize(value); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#599 def serializer; end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#567 ActionDispatch::Cookies::SerializedCookieJars::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#568 ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer # source://actionpack//lib/action_dispatch/middleware/cookies.rb#616 class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar include ::ActionDispatch::Cookies::SerializedCookieJars # @return [SignedKeyRotatingCookieJar] a new instance of SignedKeyRotatingCookieJar # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#619 def initialize(parent_jar); end private # @raise [CookieOverflow] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#638 def commit(name, options); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#632 def parse(name, signed_message, purpose: T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#189 ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/cookies.rb#197 ActionDispatch::Cookies::USE_COOKIES_WITH_METADATA = T.let(T.unsafe(nil), String) # This middleware is responsible for logging exceptions and # showing a debugging page in case the request is local. # # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#11 class ActionDispatch::DebugExceptions # @return [DebugExceptions] a new instance of DebugExceptions # # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#19 def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#26 def call(env); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#176 def api_request?(content_type); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#114 def create_template(request, wrapper); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#43 def invoke_interceptors(request, exception); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#152 def log_array(logger, lines); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#133 def log_error(request, wrapper); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#180 def log_rescued_responses?(request); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#162 def logger(request); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#129 def render(status, body, format); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#54 def render_exception(request, exception); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#90 def render_for_api_request(content_type, wrapper); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#76 def render_for_browser_request(request, wrapper); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#170 def routes_inspector(exception); end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#166 def stderr_logger; end class << self # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#12 def interceptors; end # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#14 def register_interceptor(object = T.unsafe(nil), &block); end end end # This middleware can be used to diagnose deadlocks in the autoload interlock. # # To use it, insert it near the top of the middleware stack, using # config/application.rb: # # config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks # # After restarting the application and re-triggering the deadlock condition, # the route /rails/locks will show a summary of all threads currently # known to the interlock, which lock level they are holding or awaiting, and # their current backtrace. # # Generally a deadlock will be caused by the interlock conflicting with some # other external lock or blocking I/O call. These cannot be automatically # identified, but should be visible in the displayed backtraces. # # NOTE: The formatting and content of this middleware's output is intended for # human consumption, and should be expected to change between releases. # # This middleware exposes operational details of the server, with no access # control. It should only be enabled when in use, and removed thereafter. # # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#25 class ActionDispatch::DebugLocks # @return [DebugLocks] a new instance of DebugLocks # # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#26 def initialize(app, path = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#31 def call(env); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#103 def blocked_by?(victim, blocker, all_threads); end # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#45 def render_details(req); end end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#9 class ActionDispatch::DebugView < ::ActionView::Base # @return [DebugView] a new instance of DebugView # # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#12 def initialize(assigns); end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#18 def compiled_method_container; end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#42 def debug_hash(object); end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#34 def debug_headers(headers); end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#22 def debug_params(params); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#60 def params_valid?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#56 def protect_against_forgery?; end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#46 def render(*_arg0); end end # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#10 ActionDispatch::DebugView::RESCUES_TEMPLATE_PATH = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#7 class ActionDispatch::ExceptionWrapper # @return [ExceptionWrapper] a new instance of ExceptionWrapper # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#46 def initialize(backtrace_cleaner, exception); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#77 def application_trace; end # Returns the value of attribute backtrace_cleaner. # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 def backtrace_cleaner; end # Returns the value of attribute exception. # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 def exception; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#71 def exception_trace; end # Returns the value of attribute file. # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 def file; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#81 def framework_trace; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#85 def full_trace; end # Returns the value of attribute line_number. # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 def line_number; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#121 def rescue_response?; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 def rescue_responses; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 def rescue_responses=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#63 def rescue_template; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 def rescue_templates; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 def rescue_templates=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 def silent_exceptions; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 def silent_exceptions=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#125 def source_extracts; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#144 def source_to_show_id; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#67 def status_code; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#136 def trace_to_show; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#89 def traces; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#55 def unwrapped_exception; end # Returns the value of attribute wrapped_causes. # # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 def wrapped_causes; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 def wrapper_exceptions; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 def wrapper_exceptions=(val); end private # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#149 def backtrace; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#153 def causes_for(exception); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#163 def clean_backtrace(*args); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#190 def expand_backtrace; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#183 def extract_file_and_line_number(trace); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#171 def source_fragment(path, line); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#159 def wrapped_causes_for(exception, backtrace_cleaner); end class << self # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 def rescue_responses; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 def rescue_responses=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 def rescue_templates; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 def rescue_templates=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 def silent_exceptions; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 def silent_exceptions=(val); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#117 def status_code_for_exception(class_name); end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 def wrapper_exceptions; end # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 def wrapper_exceptions=(val); end end end # source://actionpack//lib/action_dispatch/middleware/executor.rb#6 class ActionDispatch::Executor # @return [Executor] a new instance of Executor # # source://actionpack//lib/action_dispatch/middleware/executor.rb#7 def initialize(app, executor); end # source://actionpack//lib/action_dispatch/middleware/executor.rb#11 def call(env); end end # This endpoint serves static files from disk using Rack::File. # # URL paths are matched with static files according to expected # conventions: +path+, +path+.html, +path+/index.html. # # Precompressed versions of these files are checked first. Brotli (.br) # and gzip (.gz) files are supported. If +path+.br exists, this # endpoint returns that file with a Content-Encoding: br header. # # If no matching file is found, this endpoint responds 404 Not Found. # # Pass the +root+ directory to search for matching files, an optional # index: "index" to change the default +path+/index.html, and optional # additional response headers. # # source://actionpack//lib/action_dispatch/middleware/static.rb#41 class ActionDispatch::FileHandler # @return [FileHandler] a new instance of FileHandler # # source://actionpack//lib/action_dispatch/middleware/static.rb#49 def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/static.rb#63 def attempt(env); end # source://actionpack//lib/action_dispatch/middleware/static.rb#59 def call(env); end private # source://actionpack//lib/action_dispatch/middleware/static.rb#179 def clean_path(path_info); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/static.rb#143 def compressible?(content_type); end # @yield [path, content_type || "text/plain"] # # source://actionpack//lib/action_dispatch/middleware/static.rb#156 def each_candidate_filepath(path_info); end # source://actionpack//lib/action_dispatch/middleware/static.rb#147 def each_precompressed_filepath(filepath); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/static.rb#138 def file_readable?(path); end # Match a URI path to a static file to be served. # # Used by the +Static+ class to negotiate a servable file in the # +public/+ directory (see Static#call). # # Checks for +path+, +path+.html, and +path+/index.html files, # in that order, including .br and .gzip compressed extensions. # # If a matching file is found, the path and necessary response headers # (Content-Type, Content-Encoding) are returned. # # source://actionpack//lib/action_dispatch/middleware/static.rb#98 def find_file(path_info, accept_encoding:); end # source://actionpack//lib/action_dispatch/middleware/static.rb#74 def serve(request, filepath, content_headers); end # source://actionpack//lib/action_dispatch/middleware/static.rb#106 def try_files(filepath, content_type, accept_encoding:); end # source://actionpack//lib/action_dispatch/middleware/static.rb#116 def try_precompressed_files(filepath, headers, accept_encoding:); end end # Accept-Encoding value -> file extension # # source://actionpack//lib/action_dispatch/middleware/static.rb#43 ActionDispatch::FileHandler::PRECOMPRESSED = T.let(T.unsafe(nil), Hash) # The flash provides a way to pass temporary primitive-types (String, Array, Hash) between actions. Anything you place in the flash will be exposed # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create # action that sets flash[:notice] = "Post successfully created" before redirecting to a display action that can # then expose the flash to its template. Actually, that exposure is automatically done. # # class PostsController < ActionController::Base # def create # # save post # flash[:notice] = "Post successfully created" # redirect_to @post # end # # def show # # doesn't need to assign the flash notice to the template, that's done automatically # end # end # # Then in +show.html.erb+: # # <% if flash[:notice] %> #
<%= flash[:notice] %>
# <% end %> # # Since the +notice+ and +alert+ keys are a common idiom, convenience accessors are available: # # flash.alert = "You must be logged in" # flash.notice = "Post successfully created" # # This example places a string in the flash. And of course, you can put as many as you like at a time too. If you want to pass # non-primitive types, you will have to handle that in your application. Example: To show messages with links, you will have to # use sanitize helper. # # Just remember: They'll be gone by the time the next action has been performed. # # See docs on the FlashHash class for more details about the flash. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#41 class ActionDispatch::Flash class << self # source://actionpack//lib/action_dispatch/middleware/flash.rb#293 def new(app); end end end # source://actionpack//lib/action_dispatch/middleware/flash.rb#110 class ActionDispatch::Flash::FlashHash include ::Enumerable # @return [FlashHash] a new instance of FlashHash # # source://actionpack//lib/action_dispatch/middleware/flash.rb#140 def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#160 def [](k); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#154 def []=(k, v); end # Convenience accessor for flash[:alert]. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#261 def alert; end # Convenience accessor for flash[:alert]=. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#266 def alert=(message); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#193 def clear; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#178 def delete(key); end # Marks the entire flash or a single flash entry to be discarded by the end of the current action: # # flash.discard # discard the entire flash at the end of the current action # flash.discard(:warning) # discard only the "warning" entry at the end of the current action # # source://actionpack//lib/action_dispatch/middleware/flash.rb#246 def discard(k = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#198 def each(&block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/flash.rb#189 def empty?; end # Keeps either the entire current flash or a specific flash entry available for the next action: # # flash.keep # keeps the entire flash # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded # # source://actionpack//lib/action_dispatch/middleware/flash.rb#236 def keep(k = T.unsafe(nil)); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/flash.rb#174 def key?(name); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#170 def keys; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#164 def merge!(h); end # Convenience accessor for flash[:notice]. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#271 def notice; end # Convenience accessor for flash[:notice]=. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#276 def notice=(message); end # Sets a flash that will not be available to the next action, only to the current. # # flash.now[:message] = "Hello current action" # # This method enables you to use the flash as a central messaging system in your app. # When you need to pass an object to the next action, you use the standard flash assign ([]=). # When you need to pass an object to the current action, you use now, and your object will # vanish when the current action is done. # # Entries set via now are accessed the same way as standard entries: flash['my-key']. # # Also, brings two convenience accessors: # # flash.now.alert = "Beware now!" # # Equivalent to flash.now[:alert] = "Beware now!" # # flash.now.notice = "Good luck now!" # # Equivalent to flash.now[:notice] = "Good luck now!" # # source://actionpack//lib/action_dispatch/middleware/flash.rb#228 def now; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#204 def replace(h); end # Mark for removal entries that were kept, and delete unkept ones. # # This method is called automatically by filters, so you generally don't need to care about it. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#255 def sweep; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#185 def to_hash; end # Builds a hash containing the flashes to keep for the next request. # If there are none to keep, returns +nil+. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#134 def to_session_value; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#164 def update(h); end protected # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/flash.rb#281 def now_is_loaded?; end private # source://actionpack//lib/action_dispatch/middleware/flash.rb#146 def initialize_copy(other); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#286 def stringify_array(array); end class << self # source://actionpack//lib/action_dispatch/middleware/flash.rb#113 def from_session_value(value); end end end # source://actionpack//lib/action_dispatch/middleware/flash.rb#81 class ActionDispatch::Flash::FlashNow # @return [FlashNow] a new instance of FlashNow # # source://actionpack//lib/action_dispatch/middleware/flash.rb#84 def initialize(flash); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#95 def [](k); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#88 def []=(k, v); end # Convenience accessor for flash.now[:alert]=. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#100 def alert=(message); end # Returns the value of attribute flash. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#82 def flash; end # Sets the attribute flash # # @param value the value to set the attribute flash to. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#82 def flash=(_arg0); end # Convenience accessor for flash.now[:notice]=. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#105 def notice=(message); end end # source://actionpack//lib/action_dispatch/middleware/flash.rb#42 ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/flash.rb#44 module ActionDispatch::Flash::RequestMethods # source://actionpack//lib/action_dispatch/middleware/flash.rb#62 def commit_flash; end # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. # # See ActionDispatch::Flash for example usage. # # source://actionpack//lib/action_dispatch/middleware/flash.rb#48 def flash; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#54 def flash=(flash); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#58 def flash_hash; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#75 def reset_session; end end # This middleware guards from DNS rebinding attacks by explicitly permitting # the hosts a request can be sent to, and is passed the options set in # +config.host_authorization+. # # Requests can opt-out of Host Authorization with +exclude+: # # config.host_authorization = { exclude: ->(request) { request.path =~ /healthcheck/ } } # # When a request comes to an unauthorized host, the +response_app+ # application will be executed and rendered. If no +response_app+ is given, a # default one will run. # The default response app logs blocked host info with level 'error' and # responds with 403 Forbidden. The body of the response contains debug info # if +config.consider_all_requests_local+ is set to true, otherwise the body is empty. # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#18 class ActionDispatch::HostAuthorization # @return [HostAuthorization] a new instance of HostAuthorization # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#122 def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#130 def call(env); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#144 def authorized?(request); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#151 def excluded?(request); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#155 def mark_as_authorized(request); end end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#19 ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#83 class ActionDispatch::HostAuthorization::DefaultResponseApp # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#86 def call(env); end private # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#117 def available_logger(request); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#109 def log_error(request); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#102 def response(format, body); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#95 def response_body(request); end end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#84 ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#21 ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#22 ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#23 ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#20 ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#30 class ActionDispatch::HostAuthorization::Permissions # @return [Permissions] a new instance of Permissions # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#31 def initialize(hosts); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#39 def allows?(host); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#35 def empty?; end private # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#78 def extract_hostname(host); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#56 def sanitize_hosts(hosts); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#66 def sanitize_regexp(host); end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#70 def sanitize_string(host); end end # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#24 ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch.rb#80 module ActionDispatch::Http extend ::ActiveSupport::Autoload end # source://actionpack//lib/action_dispatch/http/cache.rb#5 module ActionDispatch::Http::Cache; end # source://actionpack//lib/action_dispatch/http/cache.rb#6 module ActionDispatch::Http::Cache::Request # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#28 def etag_matches?(etag); end # Check response freshness (Last-Modified and ETag) against request # If-Modified-Since and If-None-Match conditions. If both headers are # supplied, both must match, or the request is not considered fresh. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#38 def fresh?(response); end # source://actionpack//lib/action_dispatch/http/cache.rb#10 def if_modified_since; end # source://actionpack//lib/action_dispatch/http/cache.rb#16 def if_none_match; end # source://actionpack//lib/action_dispatch/http/cache.rb#20 def if_none_match_etags; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#24 def not_modified?(modified_at); end end # source://actionpack//lib/action_dispatch/http/cache.rb#7 ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#8 ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#51 module ActionDispatch::Http::Cache::Response # Returns the value of attribute cache_control. # # source://actionpack//lib/action_dispatch/http/cache.rb#52 def cache_control; end # source://actionpack//lib/action_dispatch/http/cache.rb#68 def date; end # source://actionpack//lib/action_dispatch/http/cache.rb#78 def date=(utc_time); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#74 def date?; end # This method sets a weak ETag validator on the response so browsers # and proxies may cache the response, keyed on the ETag. On subsequent # requests, the If-None-Match header is set to the cached ETag. If it # matches the current ETag, we can return a 304 Not Modified response # with no body, letting the browser or proxy know that their cache is # current. Big savings in request time and network bandwidth. # # Weak ETags are considered to be semantically equivalent but not # byte-for-byte identical. This is perfect for browser caching of HTML # pages where we don't care about exact equality, just what the user # is viewing. # # Strong ETags are considered byte-for-byte identical. They allow a # browser or proxy cache to support Range requests, useful for paging # through a PDF file or scrubbing through a video. Some CDNs only # support strong ETags and will ignore weak ETags entirely. # # Weak ETags are what we almost always need, so they're the default. # Check out #strong_etag= to provide a strong ETag validator. # # source://actionpack//lib/action_dispatch/http/cache.rb#101 def etag=(weak_validators); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#113 def etag?; end # source://actionpack//lib/action_dispatch/http/cache.rb#54 def last_modified; end # source://actionpack//lib/action_dispatch/http/cache.rb#64 def last_modified=(utc_time); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#60 def last_modified?; end # source://actionpack//lib/action_dispatch/http/cache.rb#109 def strong_etag=(strong_validators); end # True if an ETag is set and it isn't a weak validator (not preceded with W/) # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#121 def strong_etag?; end # source://actionpack//lib/action_dispatch/http/cache.rb#105 def weak_etag=(weak_validators); end # True if an ETag is set and it's a weak validator (preceded with W/) # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/cache.rb#116 def weak_etag?; end private # source://actionpack//lib/action_dispatch/http/cache.rb#146 def cache_control_headers; end # source://actionpack//lib/action_dispatch/http/cache.rb#138 def cache_control_segments; end # source://actionpack//lib/action_dispatch/http/cache.rb#134 def generate_strong_etag(validators); end # source://actionpack//lib/action_dispatch/http/cache.rb#130 def generate_weak_etag(validators); end # source://actionpack//lib/action_dispatch/http/cache.rb#175 def handle_conditional_get!; end # source://actionpack//lib/action_dispatch/http/cache.rb#185 def merge_and_normalize_cache_control!(cache_control); end # source://actionpack//lib/action_dispatch/http/cache.rb#164 def prepare_cache_control!; end end # source://actionpack//lib/action_dispatch/http/cache.rb#126 ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#168 ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#127 ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#173 ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#170 ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#169 ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#172 ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#171 ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/cache.rb#128 ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) # source://actionpack//lib/action_dispatch/http/content_disposition.rb#5 class ActionDispatch::Http::ContentDisposition # @return [ContentDisposition] a new instance of ContentDisposition # # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 def initialize(disposition:, filename:); end # source://actionpack//lib/action_dispatch/http/content_disposition.rb#19 def ascii_filename; end # Returns the value of attribute disposition. # # source://actionpack//lib/action_dispatch/http/content_disposition.rb#10 def disposition; end # Returns the value of attribute filename. # # source://actionpack//lib/action_dispatch/http/content_disposition.rb#10 def filename; end # source://actionpack//lib/action_dispatch/http/content_disposition.rb#29 def to_s; end # source://actionpack//lib/action_dispatch/http/content_disposition.rb#25 def utf8_filename; end private # source://actionpack//lib/action_dispatch/http/content_disposition.rb#38 def percent_escape(string, pattern); end class << self # source://actionpack//lib/action_dispatch/http/content_disposition.rb#6 def format(disposition:, filename:); end end end # source://actionpack//lib/action_dispatch/http/content_disposition.rb#23 ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/content_disposition.rb#17 ActionDispatch::Http::ContentDisposition::TRADITIONAL_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) # Allows you to specify sensitive parameters which will be replaced from # the request log by looking in the query string of the request and all # sub-hashes of the params hash to filter. Filtering only certain sub-keys # from a hash is possible by using the dot notation: 'credit_card.number'. # If a block is given, each key and value of the params hash and all # sub-hashes are passed to it, where the value or the key can be replaced using # String#replace or similar methods. # # env["action_dispatch.parameter_filter"] = [:password] # => replaces the value to all keys matching /password/i with "[FILTERED]" # # env["action_dispatch.parameter_filter"] = [:foo, "bar"] # => replaces the value to all keys matching /foo|bar/i with "[FILTERED]" # # env["action_dispatch.parameter_filter"] = [ /\Apin\z/i, /\Apin_/i ] # => replaces the value for the exact (case-insensitive) key 'pin' and all # (case-insensitive) keys beginning with 'pin_', with "[FILTERED]" # Does not match keys with 'pin' as a substring, such as 'shipping_id'. # # env["action_dispatch.parameter_filter"] = [ "credit_card.code" ] # => replaces { credit_card: {code: "xxxx"} } with "[FILTERED]", does not # change { file: { code: "xxxx"} } # # env["action_dispatch.parameter_filter"] = -> (k, v) do # v.reverse! if k.match?(/secret/i) # end # => reverses the value to all keys matching /secret/i # # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#34 module ActionDispatch::Http::FilterParameters # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#39 def initialize; end # Returns a hash of request.env with all sensitive data replaced. # # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#54 def filtered_env; end # Returns a hash of parameters with all sensitive data replaced. # # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#47 def filtered_parameters; end # Reconstructs a path with all sensitive GET parameters replaced. # # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#59 def filtered_path; end private # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#70 def env_filter; end # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#83 def filtered_query_string; end # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#64 def parameter_filter; end # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#77 def parameter_filter_for(filters); end end # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#35 ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#81 ActionDispatch::Http::FilterParameters::KV_RE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#37 ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#36 ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#82 ActionDispatch::Http::FilterParameters::PAIR_RE = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#5 module ActionDispatch::Http::FilterRedirect # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#8 def filtered_location; end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#25 def location_filter_match?; end # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#17 def location_filters; end end # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#6 ActionDispatch::Http::FilterRedirect::FILTERED = T.let(T.unsafe(nil), String) # Provides access to the request's HTTP headers from the environment. # # env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" } # headers = ActionDispatch::Http::Headers.from_hash(env) # headers["Content-Type"] # => "text/plain" # headers["User-Agent"] # => "curl/7.43.0" # # Also note that when headers are mapped to CGI-like variables by the Rack # server, both dashes and underscores are converted to underscores. This # ambiguity cannot be resolved at this stage anymore. Both underscores and # dashes have to be interpreted as if they were originally sent as dashes. # # # GET / HTTP/1.1 # # ... # # User-Agent: curl/7.43.0 # # X_Custom_Header: token # # headers["X_Custom_Header"] # => nil # headers["X-Custom-Header"] # => "token" # # source://actionpack//lib/action_dispatch/http/headers.rb#24 class ActionDispatch::Http::Headers include ::Enumerable # @return [Headers] a new instance of Headers # # source://actionpack//lib/action_dispatch/http/headers.rb#54 def initialize(request); end # Returns the value for the given key mapped to @env. # # source://actionpack//lib/action_dispatch/http/headers.rb#59 def [](key); end # Sets the given value for the key mapped to @env. # # source://actionpack//lib/action_dispatch/http/headers.rb#64 def []=(key, value); end # Add a value to a multivalued header like Vary or Accept-Encoding. # # source://actionpack//lib/action_dispatch/http/headers.rb#69 def add(key, value); end # source://actionpack//lib/action_dispatch/http/headers.rb#95 def each(&block); end # source://actionpack//lib/action_dispatch/http/headers.rb#116 def env; end # Returns the value for the given key mapped to @env. # # If the key is not found and an optional code block is not provided, # raises a KeyError exception. # # If the code block is provided, then it will be run and # its result returned. # # source://actionpack//lib/action_dispatch/http/headers.rb#87 def fetch(key, default = T.unsafe(nil)); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/headers.rb#73 def include?(key); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/headers.rb#73 def key?(key); end # Returns a new Http::Headers instance containing the contents of # headers_or_env and the original instance. # # source://actionpack//lib/action_dispatch/http/headers.rb#101 def merge(headers_or_env); end # Adds the contents of headers_or_env to original instance # entries; duplicate keys are overwritten with the values from # headers_or_env. # # source://actionpack//lib/action_dispatch/http/headers.rb#110 def merge!(headers_or_env); end private # Converts an HTTP header name to an environment variable name if it is # not contained within the headers hash. # # source://actionpack//lib/action_dispatch/http/headers.rb#121 def env_name(key); end class << self # source://actionpack//lib/action_dispatch/http/headers.rb#50 def from_hash(hash); end end end # source://actionpack//lib/action_dispatch/http/headers.rb#25 ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) # source://actionpack//lib/action_dispatch/http/headers.rb#78 ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) # source://actionpack//lib/action_dispatch/http/headers.rb#46 ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#7 module ActionDispatch::Http::MimeNegotiation extend ::ActiveSupport::Concern # Returns the accepted MIME type for the request. # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#54 def accepts; end # The MIME type of the HTTP request, such as Mime[:xml]. # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#23 def content_mime_type; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#36 def content_type; end # Returns the MIME type for the \format used in the request. # # GET /posts/5.xml | request.format => Mime[:xml] # GET /posts/5.xhtml | request.format => Mime[:html] # GET /posts/5 | request.format => Mime[:html] or Mime[:js], or request.accepts.first # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#75 def format(view_path = T.unsafe(nil)); end # Sets the \format by string extension, which can be used to force custom formats # that are not controlled by the extension. # # class ApplicationController < ActionController::Base # before_action :adjust_format_for_iphone # # private # def adjust_format_for_iphone # request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] # end # end # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#127 def format=(extension); end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#79 def formats; end # Sets the \formats by string extensions. This differs from #format= by allowing you # to set multiple, ordered formats, which is useful when you want to have a fallback. # # In this example, the +:iphone+ format will be used if it's available, otherwise it'll fallback # to the +:html+ format. # # class ApplicationController < ActionController::Base # before_action :adjust_format_for_iphone_with_html_fallback # # private # def adjust_format_for_iphone_with_html_fallback # request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] # end # end # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#146 def formats=(extensions); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#49 def has_content_type?; end # Returns the first MIME type that matches the provided array of MIME types. # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#154 def negotiate_mime(order); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#166 def should_apply_vary_header?; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#112 def variant; end # Sets the \variant for template. # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#102 def variant=(variant); end private # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#190 def format_from_path_extension; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#175 def params_readable?; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#186 def use_accept_header; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#181 def valid_accept_header; end end # We use normal content negotiation unless you include */* in your list, # in which case we assume you're a browser and send HTML. # # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#173 ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#10 class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#12 ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/parameters.rb#5 module ActionDispatch::Http::Parameters extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionDispatch::Http::Parameters::ClassMethods # Returns both GET and POST \parameters in a single hash. # # source://actionpack//lib/action_dispatch/http/parameters.rb#50 def parameters; end # Returns both GET and POST \parameters in a single hash. # # source://actionpack//lib/action_dispatch/http/parameters.rb#50 def params; end # Returns a hash with the \parameters used to form the \path of the request. # Returned hash keys are strings: # # { action: "my_action", controller: "my_controller" } # # source://actionpack//lib/action_dispatch/http/parameters.rb#82 def path_parameters; end # source://actionpack//lib/action_dispatch/http/parameters.rb#65 def path_parameters=(parameters); end private # source://actionpack//lib/action_dispatch/http/parameters.rb#100 def log_parse_error_once; end # source://actionpack//lib/action_dispatch/http/parameters.rb#112 def params_parsers; end # source://actionpack//lib/action_dispatch/http/parameters.rb#87 def parse_formatted_parameters(parsers); end end # source://actionpack//lib/action_dispatch/http/parameters.rb#34 module ActionDispatch::Http::Parameters::ClassMethods # Configure the parameter parser for a given MIME type. # # It accepts a hash where the key is the symbol of the MIME type # and the value is a proc. # # original_parsers = ActionDispatch::Request.parameter_parsers # xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } # new_parsers = original_parsers.merge(xml: xml_parser) # ActionDispatch::Request.parameter_parsers = new_parsers # # source://actionpack//lib/action_dispatch/http/parameters.rb#44 def parameter_parsers=(parsers); end end # source://actionpack//lib/action_dispatch/http/parameters.rb#10 ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/parameters.rb#8 ActionDispatch::Http::Parameters::PARAMETERS_KEY = T.let(T.unsafe(nil), String) # Raised when raw data from the request cannot be parsed by the parser # defined for request's content MIME type. # # source://actionpack//lib/action_dispatch/http/parameters.rb#19 class ActionDispatch::Http::Parameters::ParseError < ::StandardError # @return [ParseError] a new instance of ParseError # # source://actionpack//lib/action_dispatch/http/parameters.rb#20 def initialize(message = T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/http/url.rb#7 module ActionDispatch::Http::URL # source://actionpack//lib/action_dispatch/http/url.rb#179 def initialize; end # Returns the \domain part of a \host, such as "rubyonrails.org" in "www.rubyonrails.org". You can specify # a different tld_length, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk". # # source://actionpack//lib/action_dispatch/http/url.rb#321 def domain(tld_length = T.unsafe(nil)); end # Returns the host for this request, such as "example.com". # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.host # => "example.com" # # source://actionpack//lib/action_dispatch/http/url.rb#226 def host; end # Returns a \host:\port string for this request, such as "example.com" or # "example.com:8080". Port is only included if it is not a default port # (80 or 443) # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' # req.host_with_port # => "example.com" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' # req.host_with_port # => "example.com" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.host_with_port # => "example.com:8080" # # source://actionpack//lib/action_dispatch/http/url.rb#242 def host_with_port; end # Returns a number \port suffix like 8080 if the \port number of this request # is not the default HTTP \port 80 or HTTPS \port 443. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' # req.optional_port # => nil # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.optional_port # => 8080 # # source://actionpack//lib/action_dispatch/http/url.rb#292 def optional_port; end # Returns the port number of this request as an integer. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' # req.port # => 80 # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.port # => 8080 # # source://actionpack//lib/action_dispatch/http/url.rb#253 def port; end # Returns a string \port suffix, including colon, like ":8080" if the \port # number of this request is not the default HTTP \port 80 or HTTPS \port 443. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' # req.port_string # => "" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.port_string # => ":8080" # # source://actionpack//lib/action_dispatch/http/url.rb#304 def port_string; end # Returns 'https://' if this is an SSL request and 'http://' otherwise. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' # req.protocol # => "http://" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' # req.protocol # => "https://" # # source://actionpack//lib/action_dispatch/http/url.rb#200 def protocol; end # Returns the \host and port for this request, such as "example.com:8080". # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' # req.raw_host_with_port # => "example.com" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' # req.raw_host_with_port # => "example.com:80" # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.raw_host_with_port # => "example.com:8080" # # source://actionpack//lib/action_dispatch/http/url.rb#214 def raw_host_with_port; end # source://actionpack//lib/action_dispatch/http/url.rb#12 def secure_protocol; end # source://actionpack//lib/action_dispatch/http/url.rb#12 def secure_protocol=(val); end # Returns the requested port, such as 8080, based on SERVER_PORT # # req = ActionDispatch::Request.new 'SERVER_PORT' => '80' # req.server_port # => 80 # # req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' # req.server_port # => 8080 # # source://actionpack//lib/action_dispatch/http/url.rb#315 def server_port; end # Returns the standard \port number for this request's protocol. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.standard_port # => 80 # # source://actionpack//lib/action_dispatch/http/url.rb#265 def standard_port; end # Returns whether this request is using the standard port # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' # req.standard_port? # => true # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' # req.standard_port? # => false # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/url.rb#280 def standard_port?; end # Returns all the \subdomains as a string, so "dev.www" would be # returned for "dev.www.rubyonrails.org". You can specify a different tld_length, # such as 2 to catch "www" instead of "www.rubyonrails" # in "www.rubyonrails.co.uk". # # source://actionpack//lib/action_dispatch/http/url.rb#337 def subdomain(tld_length = T.unsafe(nil)); end # Returns all the \subdomains as an array, so ["dev", "www"] would be # returned for "dev.www.rubyonrails.org". You can specify a different tld_length, # such as 2 to catch ["www"] instead of ["www", "rubyonrails"] # in "www.rubyonrails.co.uk". # # source://actionpack//lib/action_dispatch/http/url.rb#329 def subdomains(tld_length = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/url.rb#13 def tld_length; end # source://actionpack//lib/action_dispatch/http/url.rb#13 def tld_length=(val); end # Returns the complete URL used for this request. # # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' # req.url # => "http://example.com" # # source://actionpack//lib/action_dispatch/http/url.rb#189 def url; end class << self # Returns the domain part of a host given the domain level. # # # Top-level domain example # extract_domain('www.example.com', 1) # => "example.com" # # Second-level domain example # extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk" # # source://actionpack//lib/action_dispatch/http/url.rb#22 def extract_domain(host, tld_length); end # Returns the subdomains of a host as a String given the domain level. # # # Top-level domain example # extract_subdomain('www.example.com', 1) # => "www" # # Second-level domain example # extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www" # # source://actionpack//lib/action_dispatch/http/url.rb#46 def extract_subdomain(host, tld_length); end # Returns the subdomains of a host as an Array given the domain level. # # # Top-level domain example # extract_subdomains('www.example.com', 1) # => ["www"] # # Second-level domain example # extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"] # # source://actionpack//lib/action_dispatch/http/url.rb#32 def extract_subdomains(host, tld_length); end # source://actionpack//lib/action_dispatch/http/url.rb#58 def full_url_for(options); end # source://actionpack//lib/action_dispatch/http/url.rb#70 def path_for(options); end # source://actionpack//lib/action_dispatch/http/url.rb#12 def secure_protocol; end # source://actionpack//lib/action_dispatch/http/url.rb#12 def secure_protocol=(val); end # source://actionpack//lib/action_dispatch/http/url.rb#13 def tld_length; end # source://actionpack//lib/action_dispatch/http/url.rb#13 def tld_length=(val); end # source://actionpack//lib/action_dispatch/http/url.rb#50 def url_for(options); end private # source://actionpack//lib/action_dispatch/http/url.rb#90 def add_anchor(path, anchor); end # source://actionpack//lib/action_dispatch/http/url.rb#83 def add_params(path, params); end # source://actionpack//lib/action_dispatch/http/url.rb#105 def build_host_url(host, port, protocol, options, path); end # source://actionpack//lib/action_dispatch/http/url.rb#96 def extract_domain_from(host, tld_length); end # source://actionpack//lib/action_dispatch/http/url.rb#100 def extract_subdomains_from(host, tld_length); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/url.rb#129 def named_host?(host); end # source://actionpack//lib/action_dispatch/http/url.rb#146 def normalize_host(_host, options); end # source://actionpack//lib/action_dispatch/http/url.rb#166 def normalize_port(port, protocol); end # source://actionpack//lib/action_dispatch/http/url.rb#133 def normalize_protocol(protocol); end end end # source://actionpack//lib/action_dispatch/http/url.rb#9 ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/url.rb#8 ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/url.rb#10 ActionDispatch::Http::URL::PROTOCOL_REGEXP = T.let(T.unsafe(nil), Regexp) # Models uploaded files. # # The actual file is accessible via the +tempfile+ accessor, though some # of its interface is available directly for convenience. # # Uploaded files are temporary files whose lifespan is one request. When # the object is finalized Ruby unlinks the file, so there is no need to # clean them with a separate maintenance task. # # source://actionpack//lib/action_dispatch/http/upload.rb#13 class ActionDispatch::Http::UploadedFile # @raise [ArgumentError] # @return [UploadedFile] a new instance of UploadedFile # # source://actionpack//lib/action_dispatch/http/upload.rb#27 def initialize(hash); end # Shortcut for +tempfile.close+. # # source://actionpack//lib/action_dispatch/http/upload.rb#58 def close(unlink_now = T.unsafe(nil)); end # A string with the MIME type of the file. # # source://actionpack//lib/action_dispatch/http/upload.rb#18 def content_type; end # A string with the MIME type of the file. # # source://actionpack//lib/action_dispatch/http/upload.rb#18 def content_type=(_arg0); end # Shortcut for +tempfile.eof?+. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/upload.rb#83 def eof?; end # A string with the headers of the multipart request. # # source://actionpack//lib/action_dispatch/http/upload.rb#25 def headers; end # A string with the headers of the multipart request. # # source://actionpack//lib/action_dispatch/http/upload.rb#25 def headers=(_arg0); end # Shortcut for +tempfile.open+. # # source://actionpack//lib/action_dispatch/http/upload.rb#53 def open; end # The basename of the file in the client. # # source://actionpack//lib/action_dispatch/http/upload.rb#15 def original_filename; end # The basename of the file in the client. # # source://actionpack//lib/action_dispatch/http/upload.rb#15 def original_filename=(_arg0); end # Shortcut for +tempfile.path+. # # source://actionpack//lib/action_dispatch/http/upload.rb#63 def path; end # Shortcut for +tempfile.read+. # # source://actionpack//lib/action_dispatch/http/upload.rb#48 def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end # Shortcut for +tempfile.rewind+. # # source://actionpack//lib/action_dispatch/http/upload.rb#73 def rewind; end # Shortcut for +tempfile.size+. # # source://actionpack//lib/action_dispatch/http/upload.rb#78 def size; end # A +Tempfile+ object with the actual uploaded file. Note that some of # its interface is available directly. # # source://actionpack//lib/action_dispatch/http/upload.rb#22 def tempfile; end # A +Tempfile+ object with the actual uploaded file. Note that some of # its interface is available directly. # # source://actionpack//lib/action_dispatch/http/upload.rb#22 def tempfile=(_arg0); end # source://actionpack//lib/action_dispatch/http/upload.rb#87 def to_io; end # Shortcut for +tempfile.to_path+. # # source://actionpack//lib/action_dispatch/http/upload.rb#68 def to_path; end end # source://actionpack//lib/action_dispatch.rb#40 class ActionDispatch::IllegalStateError < ::StandardError; end # source://actionpack//lib/action_dispatch/testing/integration.rb#11 module ActionDispatch::Integration; end # source://actionpack//lib/action_dispatch/testing/integration.rb#12 module ActionDispatch::Integration::RequestHelpers # Performs a DELETE request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#39 def delete(path, **args); end # Follow a single redirect response. If the last response was not a # redirect, an exception will be raised. Otherwise, the redirect is # performed on the location header. If the redirection is a 307 or 308 redirect, # the same HTTP verb will be used when redirecting, otherwise a GET request # will be performed. Any arguments are passed to the # underlying request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#61 def follow_redirect!(**args); end # Performs a GET request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#15 def get(path, **args); end # Performs a HEAD request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#45 def head(path, **args); end # Performs an OPTIONS request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#51 def options(path, **args); end # Performs a PATCH request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#27 def patch(path, **args); end # Performs a POST request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#21 def post(path, **args); end # Performs a PUT request with the given parameters. See ActionDispatch::Integration::Session#process # for more details. # # source://actionpack//lib/action_dispatch/testing/integration.rb#33 def put(path, **args); end end # source://actionpack//lib/action_dispatch/testing/integration.rb#316 module ActionDispatch::Integration::Runner include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions include ::ActionDispatch::Assertions # source://actionpack//lib/action_dispatch/testing/integration.rb#324 def initialize(*args, &blk); end # Returns the value of attribute app. # # source://actionpack//lib/action_dispatch/testing/integration.rb#321 def app; end # source://actionpack//lib/action_dispatch/testing/integration.rb#395 def assertions; end # source://actionpack//lib/action_dispatch/testing/integration.rb#399 def assertions=(assertions); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def assigns(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#329 def before_setup; end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def cookies(*_arg0, **_arg1, &_arg2); end # Copy the instance variables from the current session instance into the # test instance. # # source://actionpack//lib/action_dispatch/testing/integration.rb#405 def copy_session_variables!; end # source://actionpack//lib/action_dispatch/testing/integration.rb#344 def create_session(app); end # source://actionpack//lib/action_dispatch/testing/integration.rb#411 def default_url_options; end # source://actionpack//lib/action_dispatch/testing/integration.rb#415 def default_url_options=(options); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def delete(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def follow_redirect!(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def get(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def head(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#334 def integration_session; end # Open a new session instance. If a block is given, the new session is # yielded to the block before being returned. # # session = open_session do |sess| # sess.extend(CustomAssertions) # end # # By default, a single session is automatically created for you, but you # can use this method to open multiple sessions that ought to be tested # simultaneously. # # source://actionpack//lib/action_dispatch/testing/integration.rb#387 def open_session; end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def patch(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def post(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#367 def put(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#356 def remove!; end # Reset the current session. This is useful for testing multiple sessions # in a single test case. # # source://actionpack//lib/action_dispatch/testing/integration.rb#340 def reset!; end # source://actionpack//lib/action_dispatch/testing/integration.rb#322 def root_session; end # source://actionpack//lib/action_dispatch/testing/integration.rb#322 def root_session=(_arg0); end private # Delegate unhandled messages to the current session instance. # # source://actionpack//lib/action_dispatch/testing/integration.rb#425 def method_missing(method, *args, **_arg2, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/testing/integration.rb#420 def respond_to_missing?(method, _); end end # source://actionpack//lib/action_dispatch/testing/integration.rb#319 ActionDispatch::Integration::Runner::APP_SESSIONS = T.let(T.unsafe(nil), Hash) # An instance of this class represents a set of requests and responses # performed sequentially by a test process. Because you can instantiate # multiple sessions and run them side-by-side, you can also mimic (to some # limited extent) multiple simultaneous users interacting with your system. # # Typically, you will instantiate a new session using # IntegrationTest#open_session, rather than instantiating # Integration::Session directly. # # source://actionpack//lib/action_dispatch/testing/integration.rb#84 class ActionDispatch::Integration::Session include ::Minitest::Assertions include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions include ::ActionDispatch::Assertions include ::ActionDispatch::Integration::RequestHelpers include ::ActionDispatch::TestProcess::FixtureFile include ::ActionDispatch::TestProcess include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor # Create and initialize a new Session instance. # # @return [Session] a new instance of Session # # source://actionpack//lib/action_dispatch/testing/integration.rb#126 def initialize(app); end # The Accept header to send. # # source://actionpack//lib/action_dispatch/testing/integration.rb#103 def accept; end # The Accept header to send. # # source://actionpack//lib/action_dispatch/testing/integration.rb#103 def accept=(_arg0); end # source://actionpack//lib/action_dispatch/testing/integration.rb#90 def body(*_arg0, **_arg1, &_arg2); end # A reference to the controller instance used by the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#112 def controller; end # A map of the cookies returned by the last response, and which will be # sent with the next request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#107 def cookies; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # source://actionpack//lib/action_dispatch/testing/integration.rb#90 def headers(*_arg0, **_arg1, &_arg2); end # The hostname used in the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#94 def host; end # Sets the attribute host # Set the host name to use in the next request. # # session.host! "www.example.com" # # @param value the value to set the attribute host to. # # source://actionpack//lib/action_dispatch/testing/integration.rb#97 def host!(_arg0); end # Sets the attribute host # # @param value the value to set the attribute host to. # # source://actionpack//lib/action_dispatch/testing/integration.rb#97 def host=(_arg0); end # Specify whether or not the session should mimic a secure HTTPS request. # # session.https! # session.https!(false) # # source://actionpack//lib/action_dispatch/testing/integration.rb#174 def https!(flag = T.unsafe(nil)); end # Returns +true+ if the session is mimicking a secure HTTPS request. # # if session.https? # ... # end # # @return [Boolean] # # source://actionpack//lib/action_dispatch/testing/integration.rb#183 def https?; end # source://actionpack//lib/action_dispatch/testing/integration.rb#91 def path(*_arg0, **_arg1, &_arg2); end # Performs the actual request. # # - +method+: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) # as a symbol. # - +path+: The URI (as a String) on which you want to perform the # request. # - +params+: The HTTP parameters that you want to pass. This may # be +nil+, # a Hash, or a String that is appropriately encoded # (application/x-www-form-urlencoded or # multipart/form-data). # - +headers+: Additional headers to pass, as a Hash. The headers will be # merged into the Rack env hash. # - +env+: Additional env to pass, as a Hash. The headers will be # merged into the Rack env hash. # - +xhr+: Set to +true+ if you want to make an Ajax request. # Adds request headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH. # The headers will be merged into the Rack env hash. # - +as+: Used for encoding the request with different content type. # Supports +:json+ by default and will set the appropriate request headers. # The headers will be merged into the Rack env hash. # # This method is rarely used directly. Use +#get+, +#post+, or other standard # HTTP methods in integration tests. +#process+ is only required when using a # request method that doesn't have a method defined in the integration tests. # # This method returns the response status, after performing the request. # Furthermore, if this method was called from an ActionDispatch::IntegrationTest object, # then that object's @response instance variable will point to a Response object # which one can use to inspect the details of the response. # # Example: # process :get, '/author', params: { since: 201501011400 } # # source://actionpack//lib/action_dispatch/testing/integration.rb#220 def process(method, path, params: T.unsafe(nil), headers: T.unsafe(nil), env: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/testing/integration.rb#90 def redirect?(*_arg0, **_arg1, &_arg2); end # The remote_addr used in the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#100 def remote_addr; end # The remote_addr used in the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#100 def remote_addr=(_arg0); end # A reference to the request instance used by the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#115 def request; end # A running counter of the number of requests processed. # # source://actionpack//lib/action_dispatch/testing/integration.rb#121 def request_count; end # A running counter of the number of requests processed. # # source://actionpack//lib/action_dispatch/testing/integration.rb#121 def request_count=(_arg0); end # Resets the instance. This can be used to reset the state information # in an existing session instance, so it can be used from a clean-slate # condition. # # session.reset! # # source://actionpack//lib/action_dispatch/testing/integration.rb#150 def reset!; end # A reference to the response instance used by the last request. # # source://actionpack//lib/action_dispatch/testing/integration.rb#118 def response; end # source://actionpack//lib/action_dispatch/testing/integration.rb#90 def status(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#90 def status_message(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/testing/integration.rb#133 def url_options; end private # source://actionpack//lib/action_dispatch/testing/integration.rb#300 def _mock_session; end # @yield [location] # # source://actionpack//lib/action_dispatch/testing/integration.rb#308 def build_expanded_path(path); end # source://actionpack//lib/action_dispatch/testing/integration.rb#304 def build_full_uri(path, env); end class << self # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end end end # source://actionpack//lib/action_dispatch/testing/integration.rb#85 ActionDispatch::Integration::Session::DEFAULT_HOST = T.let(T.unsafe(nil), String) # An integration test spans multiple controllers and actions, # tying them all together to ensure they work together as expected. It tests # more completely than either unit or functional tests do, exercising the # entire stack, from the dispatcher to the database. # # At its simplest, you simply extend IntegrationTest and write your tests # using the get/post methods: # # require "test_helper" # # class ExampleTest < ActionDispatch::IntegrationTest # fixtures :people # # def test_login # # get the login page # get "/login" # assert_equal 200, status # # # post the login and follow through to the home page # post "/login", params: { username: people(:jamis).username, # password: people(:jamis).password } # follow_redirect! # assert_equal 200, status # assert_equal "/home", path # end # end # # However, you can also have multiple session instances open per test, and # even extend those instances with assertions and methods to create a very # powerful testing DSL that is specific for your application. You can even # reference any named routes you happen to have defined. # # require "test_helper" # # class AdvancedTest < ActionDispatch::IntegrationTest # fixtures :people, :rooms # # def test_login_and_speak # jamis, david = login(:jamis), login(:david) # room = rooms(:office) # # jamis.enter(room) # jamis.speak(room, "anybody home?") # # david.enter(room) # david.speak(room, "hello!") # end # # private # # module CustomAssertions # def enter(room) # # reference a named route, for maximum internal consistency! # get(room_url(id: room.id)) # assert(...) # ... # end # # def speak(room, message) # post "/say/#{room.id}", xhr: true, params: { message: message } # assert(...) # ... # end # end # # def login(who) # open_session do |sess| # sess.extend(CustomAssertions) # who = people(who) # sess.post "/login", params: { username: who.username, # password: who.password } # assert(...) # end # end # end # # Another longer example would be: # # A simple integration test that exercises multiple controllers: # # require "test_helper" # # class UserFlowsTest < ActionDispatch::IntegrationTest # test "login and browse site" do # # login via https # https! # get "/login" # assert_response :success # # post "/login", params: { username: users(:david).username, password: users(:david).password } # follow_redirect! # assert_equal '/welcome', path # assert_equal 'Welcome david!', flash[:notice] # # https!(false) # get "/articles/all" # assert_response :success # assert_select 'h1', 'Articles' # end # end # # As you can see the integration test involves multiple controllers and # exercises the entire stack from database to dispatcher. In addition you can # have multiple session instances open simultaneously in a test and extend # those instances with assertion methods to create a very powerful testing # DSL (domain-specific language) just for your application. # # Here's an example of multiple sessions and custom DSL in an integration test # # require "test_helper" # # class UserFlowsTest < ActionDispatch::IntegrationTest # test "login and browse site" do # # User david logs in # david = login(:david) # # User guest logs in # guest = login(:guest) # # # Both are now available in different sessions # assert_equal 'Welcome david!', david.flash[:notice] # assert_equal 'Welcome guest!', guest.flash[:notice] # # # User david can browse site # david.browses_site # # User guest can browse site as well # guest.browses_site # # # Continue with other assertions # end # # private # # module CustomDsl # def browses_site # get "/products/all" # assert_response :success # assert_select 'h1', 'Products' # end # end # # def login(user) # open_session do |sess| # sess.extend(CustomDsl) # u = users(user) # sess.https! # sess.post "/login", params: { username: u.username, password: u.password } # assert_equal '/welcome', sess.path # sess.https!(false) # end # end # end # # See the {request helpers documentation}[rdoc-ref:ActionDispatch::Integration::RequestHelpers] for help on how to # use +get+, etc. # # === Changing the request encoding # # You can also test your JSON API easily by setting what the request should # be encoded as: # # require "test_helper" # # class ApiTest < ActionDispatch::IntegrationTest # test "creates articles" do # assert_difference -> { Article.count } do # post articles_path, params: { article: { title: "Ahoy!" } }, as: :json # end # # assert_response :success # assert_equal({ id: Article.last.id, title: "Ahoy!" }, response.parsed_body) # end # end # # The +as+ option passes an "application/json" Accept header (thereby setting # the request format to JSON unless overridden), sets the content type to # "application/json" and encodes the parameters as JSON. # # Calling +parsed_body+ on the response parses the response body based on the # last response MIME type. # # Out of the box, only :json is supported. But for any custom MIME # types you've registered, you can add your own encoders with: # # ActionDispatch::IntegrationTest.register_encoder :wibble, # param_encoder: -> params { params.to_wibble }, # response_parser: -> body { body } # # Where +param_encoder+ defines how the params should be encoded and # +response_parser+ defines how the response body should be parsed through # +parsed_body+. # # Consult the Rails Testing Guide for more. # # source://actionpack//lib/action_dispatch/testing/integration.rb#631 class ActionDispatch::IntegrationTest < ::ActiveSupport::TestCase include ::ActionDispatch::TestProcess::FixtureFile include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions include ::ActionDispatch::Assertions include ::ActionDispatch::Integration::Runner include ::ActionController::TemplateAssertions include ::ActionDispatch::IntegrationTest::Behavior include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor include ::ActionDispatch::IntegrationTest::UrlOptions extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods end # source://actionpack//lib/action_dispatch/testing/integration.rb#641 module ActionDispatch::IntegrationTest::Behavior include ::ActionDispatch::Assertions::ResponseAssertions include ::ActionDispatch::Assertions::RoutingAssertions include ::Rails::Dom::Testing::Assertions::DomAssertions include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable include ::Rails::Dom::Testing::Assertions::SelectorAssertions include ::Rails::Dom::Testing::Assertions include ::ActionDispatch::Assertions include ::ActionDispatch::Integration::Runner include ::ActionController::TemplateAssertions extend ::ActiveSupport::Concern include ::ActionDispatch::Routing::UrlFor include ::ActionDispatch::IntegrationTest::UrlOptions mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods # source://actionpack//lib/action_dispatch/testing/integration.rb#672 def app; end # source://actionpack//lib/action_dispatch/testing/integration.rb#676 def document_root_element; end end # source://actionpack//lib/action_dispatch/testing/integration.rb#654 module ActionDispatch::IntegrationTest::Behavior::ClassMethods # source://actionpack//lib/action_dispatch/testing/integration.rb#655 def app; end # source://actionpack//lib/action_dispatch/testing/integration.rb#663 def app=(app); end # source://actionpack//lib/action_dispatch/testing/integration.rb#667 def register_encoder(*args, **options); end end # source://actionpack//lib/action_dispatch/testing/integration.rb#634 module ActionDispatch::IntegrationTest::UrlOptions extend ::ActiveSupport::Concern # source://actionpack//lib/action_dispatch/testing/integration.rb#636 def url_options; end end # :stopdoc: # # source://actionpack//lib/action_dispatch/journey/router/utils.rb#4 module ActionDispatch::Journey; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#7 class ActionDispatch::Journey::Ast # @return [Ast] a new instance of Ast # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#11 def initialize(tree, formatted); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#37 def glob?; end # Returns the value of attribute names. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def names; end # Returns the value of attribute path_params. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def path_params; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#23 def requirements=(requirements); end # Returns the value of attribute tree. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def root; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#33 def route=(route); end # Returns the value of attribute terminals. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def terminals; end # Returns the value of attribute tree. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def tree; end # Returns the value of attribute wildcard_options. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 def wildcard_options; end private # Returns the value of attribute stars. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#42 def stars; end # Returns the value of attribute symbols. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#42 def symbols; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#44 def visit_tree(formatted); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#6 class ActionDispatch::Journey::Format # @return [Format] a new instance of Format # # source://actionpack//lib/action_dispatch/journey/visitors.rb#22 def initialize(parts); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#37 def evaluate(hash); end class << self # source://actionpack//lib/action_dispatch/journey/visitors.rb#14 def required_path(symbol); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#18 def required_segment(symbol); end end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#7 ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/journey/visitors.rb#8 ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/journey/visitors.rb#10 class ActionDispatch::Journey::Format::Parameter < ::Struct # source://actionpack//lib/action_dispatch/journey/visitors.rb#11 def escape(value); end # Returns the value of attribute escaper # # @return [Object] the current value of escaper def escaper; end # Sets the attribute escaper # # @param value [Object] the value to set the attribute escaper to. # @return [Object] the newly set value def escaper=(_); end # Returns the value of attribute name # # @return [Object] the current value of name def name; end # Sets the attribute name # # @param value [Object] the value to set the attribute name to. # @return [Object] the newly set value def name=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # The Formatter class is used for formatting URLs. For example, parameters # passed to +url_for+ in Rails will eventually call Formatter#generate. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#10 class ActionDispatch::Journey::Formatter # @return [Formatter] a new instance of Formatter # # source://actionpack//lib/action_dispatch/journey/formatter.rb#13 def initialize(routes); end # source://actionpack//lib/action_dispatch/journey/formatter.rb#97 def clear; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#59 def generate(name, options, path_parameters); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#11 def routes; end private # source://actionpack//lib/action_dispatch/journey/formatter.rb#196 def build_cache; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#207 def cache; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#102 def extract_parameterized_parts(route, options, recall); end # source://actionpack//lib/action_dispatch/journey/formatter.rb#129 def match_route(name, options); end # Returns an array populated with missing keys if any are present. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#168 def missing_keys(route, parts); end # source://actionpack//lib/action_dispatch/journey/formatter.rb#125 def named_routes; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#151 def non_recursive(cache, options); end # source://actionpack//lib/action_dispatch/journey/formatter.rb#188 def possibles(cache, options, depth = T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/journey/formatter.rb#32 class ActionDispatch::Journey::Formatter::MissingRoute # @return [MissingRoute] a new instance of MissingRoute # # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 def initialize(constraints, missing_keys, unmatched_keys, routes, name); end # Returns the value of attribute constraints. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 def constraints; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#51 def message; end # Returns the value of attribute missing_keys. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 def missing_keys; end # Returns the value of attribute name. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 def name; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#47 def params; end # @raise [ActionController::UrlGenerationError] # # source://actionpack//lib/action_dispatch/journey/formatter.rb#43 def path(method_name); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 def routes; end # Returns the value of attribute unmatched_keys. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 def unmatched_keys; end end # source://actionpack//lib/action_dispatch/journey/formatter.rb#18 class ActionDispatch::Journey::Formatter::RouteWithParams # @return [RouteWithParams] a new instance of RouteWithParams # # source://actionpack//lib/action_dispatch/journey/formatter.rb#21 def initialize(route, parameterized_parts, params); end # Returns the value of attribute params. # # source://actionpack//lib/action_dispatch/journey/formatter.rb#19 def params; end # source://actionpack//lib/action_dispatch/journey/formatter.rb#27 def path(_); end end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#7 module ActionDispatch::Journey::GTG; end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#8 class ActionDispatch::Journey::GTG::Builder # @return [Builder] a new instance of Builder # # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 def initialize(root); end # Returns the value of attribute ast. # # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 def ast; end # Returns the value of attribute endpoints. # # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 def endpoints; end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#86 def firstpos(node); end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#107 def lastpos(node); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#64 def nullable?(node); end # Returns the value of attribute root. # # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 def root; end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#19 def transition_table; end private # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#129 def build_followpos; end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#142 def symbol(edge); end end # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#9 ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#8 class ActionDispatch::Journey::GTG::MatchData # @return [MatchData] a new instance of MatchData # # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#11 def initialize(memos); end # Returns the value of attribute memos. # # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#9 def memos; end end # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#16 class ActionDispatch::Journey::GTG::Simulator # @return [Simulator] a new instance of Simulator # # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#21 def initialize(transition_table); end # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#25 def memos(string); end # Returns the value of attribute tt. # # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#19 def tt; end end # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#17 ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#8 class ActionDispatch::Journey::GTG::TransitionTable include ::ActionDispatch::Journey::NFA::Dot # @return [TransitionTable] a new instance of TransitionTable # # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#16 def initialize; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#163 def []=(from, to, sym); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#32 def accepting?(state); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#28 def accepting_states; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#24 def add_accepting(state); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#36 def add_memo(idx, memo); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#98 def as_json(options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#44 def eclosure(t); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#40 def memo(idx); end # Returns the value of attribute memos. # # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#11 def memos; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#48 def move(t, full_string, start_index, end_index); end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#180 def states; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#115 def to_svg; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#187 def transitions; end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#125 def visualizer(paths, title = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#198 def states_hash_for(sym); end end # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#13 ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#14 ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP_ANCHORED = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#5 module ActionDispatch::Journey::NFA; end # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#6 module ActionDispatch::Journey::NFA::Dot # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#7 def to_dot; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#67 module ActionDispatch::Journey::Nodes; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#180 class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node # @return [Binary] a new instance of Binary # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 def initialize(left, right); end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#188 def children; end # Returns the value of attribute right. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#181 def right; end # Sets the attribute right # # @param value the value to set the attribute right to. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#181 def right=(_arg0); end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#191 class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#192 def cat?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#193 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#132 class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#133 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#120 class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal # @return [Dummy] a new instance of Dummy # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#121 def initialize(x = T.unsafe(nil)); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#125 def literal?; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#157 class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#159 def group?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#158 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#115 class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#116 def literal?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#117 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#68 class ActionDispatch::Journey::Nodes::Node include ::Enumerable # @return [Node] a new instance of Node # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#73 def initialize(left); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#106 def cat?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#78 def each(&block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#107 def group?; end # Returns the value of attribute left. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 def left; end # Sets the attribute left # # @param value the value to set the attribute left to. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 def left=(_arg0); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#103 def literal?; end # Returns the value of attribute memo. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 def memo; end # Sets the attribute memo # # @param value the value to set the attribute memo to. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 def memo=(_arg0); end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#94 def name; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#105 def star?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#102 def symbol?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#104 def terminal?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#86 def to_dot; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#82 def to_s; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#90 def to_sym; end # @raise [NotImplementedError] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#98 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#196 class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node # @return [Or] a new instance of Or # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#199 def initialize(children); end # Returns the value of attribute children. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#197 def children; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#203 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#128 class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#129 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#162 class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary # @return [Star] a new instance of Star # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 def initialize(left); end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#175 def name; end # Returns the value of attribute regexp. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#163 def regexp; end # Sets the attribute regexp # # @param value the value to set the attribute regexp to. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#163 def regexp=(_arg0); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#172 def star?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#173 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#136 class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal # @return [Symbol] a new instance of Symbol # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#143 def initialize(left, regexp = T.unsafe(nil)); end # Returns the value of attribute name. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 def name; end # Returns the value of attribute regexp. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 def regexp; end # Sets the attribute regexp # # @param value the value to set the attribute regexp to. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 def regexp=(_arg0); end # Returns the value of attribute regexp. # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 def symbol; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#150 def symbol?; end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#149 def type; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#141 ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#142 ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#110 class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 def symbol; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#112 def terminal?; end end # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#153 class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#154 def children; end end # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#9 class ActionDispatch::Journey::Parser < ::Racc::Parser include ::ActionDispatch::Journey::Nodes # @return [Parser] a new instance of Parser # # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#16 def initialize; end # reduce 0 omitted # # source://actionpack//lib/action_dispatch/journey/parser.rb#137 def _reduce_1(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#165 def _reduce_10(val, _values); end # reduce 14 omitted # # source://actionpack//lib/action_dispatch/journey/parser.rb#177 def _reduce_15(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#181 def _reduce_16(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#185 def _reduce_17(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#189 def _reduce_18(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#141 def _reduce_2(val, _values); end # reduce 6 omitted # # source://actionpack//lib/action_dispatch/journey/parser.rb#153 def _reduce_7(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#157 def _reduce_8(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#161 def _reduce_9(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser.rb#193 def _reduce_none(val, _values); end # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#25 def next_token; end # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#20 def parse(string); end class << self # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#12 def parse(string); end end end # source://actionpack//lib/action_dispatch/journey/parser.rb#92 ActionDispatch::Journey::Parser::Racc_arg = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/journey/parser.rb#131 ActionDispatch::Journey::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) # source://actionpack//lib/action_dispatch/journey/parser.rb#108 ActionDispatch::Journey::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#5 module ActionDispatch::Journey::Path; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#6 class ActionDispatch::Journey::Path::Pattern # @return [Pattern] a new instance of Pattern # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 def initialize(ast, requirements, separators, anchored); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#156 def =~(other); end # Returns the value of attribute anchored. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 def anchored; end # Returns the value of attribute ast. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 def ast; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#23 def build_formatter; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#27 def eager_load!; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#156 def match(other); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#162 def match?(other); end # Returns the value of attribute names. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 def names; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#59 def optional_names; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#55 def required_names; end # Returns the value of attribute requirements. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 def requirements; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#34 def requirements_anchored?; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#174 def requirements_for_missing_keys_check; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#166 def source; end # Returns the value of attribute spec. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 def spec; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#170 def to_regexp; end private # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#185 def offsets; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#181 def regexp_visitor; end end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#65 class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor # @return [AnchoredRegexp] a new instance of AnchoredRegexp # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#66 def initialize(separator, matchers); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#73 def accept(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#77 def visit_CAT(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#94 def visit_DOT(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#90 def visit_GROUP(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#94 def visit_LITERAL(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#108 def visit_OR(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#99 def visit_SLASH(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#103 def visit_STAR(node); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#81 def visit_SYMBOL(node); end end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#121 class ActionDispatch::Journey::Path::Pattern::MatchData # @return [MatchData] a new instance of MatchData # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#124 def initialize(names, offsets, match); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#138 def [](x); end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#130 def captures; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#143 def length; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#134 def named_captures; end # Returns the value of attribute names. # # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#122 def names; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#147 def post_match; end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#151 def to_s; end end # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#114 class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#115 def accept(node); end end # source://actionpack//lib/action_dispatch/journey/route.rb#6 class ActionDispatch::Journey::Route # +path+ is a path constraint. # +constraints+ is a hash of constraints to be applied to this route. # # @return [Route] a new instance of Route # # source://actionpack//lib/action_dispatch/journey/route.rb#56 def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), request_method_match: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil)); end # Returns the value of attribute app. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def app; end # Returns the value of attribute ast. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def ast; end # Returns the value of attribute constraints. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def conditions; end # Returns the value of attribute constraints. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def constraints; end # Returns the value of attribute defaults. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def defaults; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/route.rb#141 def dispatcher?; end # source://actionpack//lib/action_dispatch/journey/route.rb#77 def eager_load!; end # source://actionpack//lib/action_dispatch/journey/route.rb#119 def format(path_options); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/route.rb#137 def glob?; end # Returns the value of attribute internal. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def internal; end # source://actionpack//lib/action_dispatch/journey/route.rb#163 def ip; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/route.rb#145 def matches?(request); end # Returns the value of attribute name. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def name; end # source://actionpack//lib/action_dispatch/journey/route.rb#114 def parts; end # Returns the value of attribute path. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def path; end # Returns the value of attribute precedence. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def precedence; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/route.rb#127 def required_default?(key); end # source://actionpack//lib/action_dispatch/journey/route.rb#131 def required_defaults; end # source://actionpack//lib/action_dispatch/journey/route.rb#102 def required_keys; end # source://actionpack//lib/action_dispatch/journey/route.rb#123 def required_parts; end # Needed for `bin/rails routes`. Picks up succinctly defined requirements # for a route, for example route # # get 'photo/:id', :controller => 'photos', :action => 'show', # :id => /[A-Z]\d{5}/ # # will have {:controller=>"photos", :action=>"show", :id=>/[A-Z]\d{5}/} # as requirements. # # source://actionpack//lib/action_dispatch/journey/route.rb#92 def requirements; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/route.rb#167 def requires_matching_verb?; end # Returns the value of attribute scope_options. # # source://actionpack//lib/action_dispatch/journey/route.rb#7 def scope_options; end # source://actionpack//lib/action_dispatch/journey/route.rb#106 def score(supplied_keys); end # source://actionpack//lib/action_dispatch/journey/route.rb#114 def segment_keys; end # source://actionpack//lib/action_dispatch/journey/route.rb#98 def segments; end # source://actionpack//lib/action_dispatch/journey/route.rb#171 def verb; end private # source://actionpack//lib/action_dispatch/journey/route.rb#180 def match_verb(request); end # source://actionpack//lib/action_dispatch/journey/route.rb#176 def verbs; end class << self # source://actionpack//lib/action_dispatch/journey/route.rb#47 def verb_matcher(verb); end end end # source://actionpack//lib/action_dispatch/journey/route.rb#12 module ActionDispatch::Journey::Route::VerbMatchers; end # source://actionpack//lib/action_dispatch/journey/route.rb#34 class ActionDispatch::Journey::Route::VerbMatchers::All class << self # source://actionpack//lib/action_dispatch/journey/route.rb#35 def call(_); end # source://actionpack//lib/action_dispatch/journey/route.rb#36 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::DELETE class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::GET class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::HEAD class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::LINK class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::PATCH class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::POST class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::PUT class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::TRACE class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#17 class ActionDispatch::Journey::Route::VerbMatchers::UNLINK class << self # source://actionpack//lib/action_dispatch/journey/route.rb#19 def call(req); end # source://actionpack//lib/action_dispatch/journey/route.rb#18 def verb; end end end # source://actionpack//lib/action_dispatch/journey/route.rb#24 class ActionDispatch::Journey::Route::VerbMatchers::Unknown # @return [Unknown] a new instance of Unknown # # source://actionpack//lib/action_dispatch/journey/route.rb#27 def initialize(verb); end # source://actionpack//lib/action_dispatch/journey/route.rb#31 def call(request); end # Returns the value of attribute verb. # # source://actionpack//lib/action_dispatch/journey/route.rb#25 def verb; end end # source://actionpack//lib/action_dispatch/journey/route.rb#13 ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/journey/route.rb#39 ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#5 class ActionDispatch::Journey::Router # @return [Router] a new instance of Router # # source://actionpack//lib/action_dispatch/journey/router.rb#20 def initialize(routes); end # source://actionpack//lib/action_dispatch/journey/router.rb#24 def eager_load!; end # source://actionpack//lib/action_dispatch/journey/router.rb#65 def recognize(rails_req); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/journey/router.rb#18 def routes; end # Sets the attribute routes # # @param value the value to set the attribute routes to. # # source://actionpack//lib/action_dispatch/journey/router.rb#18 def routes=(_arg0); end # source://actionpack//lib/action_dispatch/journey/router.rb#31 def serve(req); end # source://actionpack//lib/action_dispatch/journey/router.rb#78 def visualizer; end private # source://actionpack//lib/action_dispatch/journey/router.rb#92 def ast; end # source://actionpack//lib/action_dispatch/journey/router.rb#100 def custom_routes; end # source://actionpack//lib/action_dispatch/journey/router.rb#104 def filter_routes(path); end # source://actionpack//lib/action_dispatch/journey/router.rb#109 def find_routes(req); end # source://actionpack//lib/action_dispatch/journey/router.rb#134 def match_head_routes(routes, req); end # source://actionpack//lib/action_dispatch/journey/router.rb#86 def partitioned_routes; end # source://actionpack//lib/action_dispatch/journey/router.rb#96 def simulator; end end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#6 class ActionDispatch::Journey::Router::Utils class << self # source://actionpack//lib/action_dispatch/journey/router/utils.rb#90 def escape_fragment(fragment); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#82 def escape_path(path); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#86 def escape_segment(segment); end # Normalizes URI path. # # Strips off trailing slash and ensures there is a leading slash. # Also converts downcase URL encoded string to uppercase. # # normalize_path("/foo") # => "/foo" # normalize_path("/foo/") # => "/foo" # normalize_path("foo") # => "/foo" # normalize_path("") # => "/" # normalize_path("/%ab") # => "/%AB" # # source://actionpack//lib/action_dispatch/journey/router/utils.rb#17 def normalize_path(path); end # Replaces any escaped sequences with their unescaped representations. # # uri = "/topics?title=Ruby%20on%20Rails" # unescape_uri(uri) #=> "/topics?title=Ruby on Rails" # # source://actionpack//lib/action_dispatch/journey/router/utils.rb#98 def unescape_uri(uri); end end end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#80 ActionDispatch::Journey::Router::Utils::ENCODER = T.let(T.unsafe(nil), ActionDispatch::Journey::Router::Utils::UriEncoder) # URI path and fragment escaping # https://tools.ietf.org/html/rfc3986 # # source://actionpack//lib/action_dispatch/journey/router/utils.rb#33 class ActionDispatch::Journey::Router::Utils::UriEncoder # source://actionpack//lib/action_dispatch/journey/router/utils.rb#51 def escape_fragment(fragment); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#55 def escape_path(path); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#59 def escape_segment(segment); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#63 def unescape_uri(uri); end private # source://actionpack//lib/action_dispatch/journey/router/utils.rb#69 def escape(component, pattern); end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#73 def percent_encode(unsafe); end end # source://actionpack//lib/action_dispatch/journey/router/utils.rb#40 ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#38 ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#41 ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#37 ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#34 ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#45 ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#47 ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#49 ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#48 ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#43 ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#42 ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#35 ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) # source://actionpack//lib/action_dispatch/journey/router/utils.rb#36 ActionDispatch::Journey::Router::Utils::UriEncoder::UTF_8 = T.let(T.unsafe(nil), Encoding) # The Routing table. Contains all routes for a system. Routes can be # added to the table by calling Routes#add_route. # # source://actionpack//lib/action_dispatch/journey/routes.rb#7 class ActionDispatch::Journey::Routes include ::Enumerable # @return [Routes] a new instance of Routes # # source://actionpack//lib/action_dispatch/journey/routes.rb#12 def initialize; end # source://actionpack//lib/action_dispatch/journey/routes.rb#65 def add_route(name, mapping); end # Returns the value of attribute anchored_routes. # # source://actionpack//lib/action_dispatch/journey/routes.rb#10 def anchored_routes; end # source://actionpack//lib/action_dispatch/journey/routes.rb#51 def ast; end # source://actionpack//lib/action_dispatch/journey/routes.rb#37 def clear; end # Returns the value of attribute custom_routes. # # source://actionpack//lib/action_dispatch/journey/routes.rb#10 def custom_routes; end # source://actionpack//lib/action_dispatch/journey/routes.rb#33 def each(&block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/routes.rb#20 def empty?; end # source://actionpack//lib/action_dispatch/journey/routes.rb#29 def last; end # source://actionpack//lib/action_dispatch/journey/routes.rb#24 def length; end # source://actionpack//lib/action_dispatch/journey/routes.rb#43 def partition_route(route); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/journey/routes.rb#10 def routes; end # source://actionpack//lib/action_dispatch/journey/routes.rb#58 def simulator; end # source://actionpack//lib/action_dispatch/journey/routes.rb#24 def size; end private # source://actionpack//lib/action_dispatch/journey/routes.rb#74 def clear_cache!; end end # source://actionpack//lib/action_dispatch/journey/scanner.rb#7 class ActionDispatch::Journey::Scanner # @return [Scanner] a new instance of Scanner # # source://actionpack//lib/action_dispatch/journey/scanner.rb#8 def initialize; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/journey/scanner.rb#16 def eos?; end # source://actionpack//lib/action_dispatch/journey/scanner.rb#28 def next_token; end # source://actionpack//lib/action_dispatch/journey/scanner.rb#20 def pos; end # source://actionpack//lib/action_dispatch/journey/scanner.rb#24 def pre_match; end # source://actionpack//lib/action_dispatch/journey/scanner.rb#12 def scan_setup(str); end private # takes advantage of String @- deduping capabilities in Ruby 2.5 upwards # see: https://bugs.ruby-lang.org/issues/13077 # # source://actionpack//lib/action_dispatch/journey/scanner.rb#38 def dedup_scan(regex); end # source://actionpack//lib/action_dispatch/journey/scanner.rb#43 def scan; end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#53 module ActionDispatch::Journey::Visitors; end # source://actionpack//lib/action_dispatch/journey/visitors.rb#194 class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor # @return [Dot] a new instance of Dot # # source://actionpack//lib/action_dispatch/journey/visitors.rb#195 def initialize; end # source://actionpack//lib/action_dispatch/journey/visitors.rb#200 def accept(node, seed = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/journey/visitors.rb#215 def binary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#222 def nary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#254 def terminal(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#229 def unary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#239 def visit_CAT(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#234 def visit_GROUP(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#249 def visit_OR(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#244 def visit_STAR(node, seed); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#260 ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) # Loop through the requirements AST. # # source://actionpack//lib/action_dispatch/journey/visitors.rb#159 class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor # source://actionpack//lib/action_dispatch/journey/visitors.rb#160 def visit(node, block); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#165 ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) # source://actionpack//lib/action_dispatch/journey/visitors.rb#134 class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor # source://actionpack//lib/action_dispatch/journey/visitors.rb#135 def accept(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#138 def binary(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#136 def terminal(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#142 def visit_GROUP(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#144 def visit_STAR(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#148 def visit_SYMBOL(n); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#95 class ActionDispatch::Journey::Visitors::FunctionalVisitor # source://actionpack//lib/action_dispatch/journey/visitors.rb#98 def accept(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#106 def binary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#111 def nary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#122 def terminal(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#116 def unary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#102 def visit(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#109 def visit_CAT(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#126 def visit_DOT(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#119 def visit_GROUP(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#123 def visit_LITERAL(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#114 def visit_OR(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#125 def visit_SLASH(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#120 def visit_STAR(n, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#124 def visit_SYMBOL(n, seed); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#96 ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/journey/visitors.rb#168 class ActionDispatch::Journey::Visitors::String < ::ActionDispatch::Journey::Visitors::FunctionalVisitor private # source://actionpack//lib/action_dispatch/journey/visitors.rb#170 def binary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#174 def nary(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#183 def terminal(node, seed); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#187 def visit_GROUP(node, seed); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#191 ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) # source://actionpack//lib/action_dispatch/journey/visitors.rb#54 class ActionDispatch::Journey::Visitors::Visitor # source://actionpack//lib/action_dispatch/journey/visitors.rb#57 def accept(node); end private # source://actionpack//lib/action_dispatch/journey/visitors.rb#66 def binary(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#72 def nary(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#83 def terminal(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#77 def unary(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#62 def visit(node); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#70 def visit_CAT(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#87 def visit_DOT(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#80 def visit_GROUP(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#84 def visit_LITERAL(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#75 def visit_OR(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#86 def visit_SLASH(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#81 def visit_STAR(n); end # source://actionpack//lib/action_dispatch/journey/visitors.rb#85 def visit_SYMBOL(n); end end # source://actionpack//lib/action_dispatch/journey/visitors.rb#55 ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/middleware/stack.rb#7 class ActionDispatch::MiddlewareStack include ::Enumerable # @return [MiddlewareStack] a new instance of MiddlewareStack # @yield [_self] # @yieldparam _self [ActionDispatch::MiddlewareStack] the object that the method was called on # # source://actionpack//lib/action_dispatch/middleware/stack.rb#70 def initialize(*args); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#87 def [](i); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#160 def build(app = T.unsafe(nil), &block); end # Deletes a middleware from the middleware stack. # # Returns the array of middlewares not including the deleted item, or # returns nil if the target is not found. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#125 def delete(target); end # Deletes a middleware from the middleware stack. # # Returns the array of middlewares not including the deleted item, or # raises +RuntimeError+ if the target is not found. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#133 def delete!(target); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#75 def each(&block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#100 def insert(index, klass, *args, **_arg3, &block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#108 def insert_after(index, *args, **_arg2, &block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#100 def insert_before(index, klass, *args, **_arg3, &block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#83 def last; end # Returns the value of attribute middlewares. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#68 def middlewares; end # Sets the attribute middlewares # # @param value the value to set the attribute middlewares to. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#68 def middlewares=(_arg0); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#137 def move(target, source); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#147 def move_after(target, source); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#137 def move_before(target, source); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#79 def size; end # source://actionpack//lib/action_dispatch/middleware/stack.rb#114 def swap(target, *args, **_arg2, &block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#91 def unshift(klass, *args, **_arg2, &block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#155 def use(klass, *args, **_arg2, &block); end private # source://actionpack//lib/action_dispatch/middleware/stack.rb#172 def assert_index(index, where); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#178 def build_middleware(klass, args, block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#182 def index_of(klass); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#96 def initialize_copy(other); end end # This class is used to instrument the execution of a single middleware. # It proxies the +call+ method transparently and instruments the method # call. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#48 class ActionDispatch::MiddlewareStack::InstrumentationProxy # @return [InstrumentationProxy] a new instance of InstrumentationProxy # # source://actionpack//lib/action_dispatch/middleware/stack.rb#51 def initialize(middleware, class_name); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#59 def call(env); end end # source://actionpack//lib/action_dispatch/middleware/stack.rb#49 ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/stack.rb#8 class ActionDispatch::MiddlewareStack::Middleware # @return [Middleware] a new instance of Middleware # # source://actionpack//lib/action_dispatch/middleware/stack.rb#11 def initialize(klass, args, block); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#19 def ==(middleware); end # Returns the value of attribute args. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 def args; end # Returns the value of attribute block. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 def block; end # source://actionpack//lib/action_dispatch/middleware/stack.rb#36 def build(app); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#40 def build_instrumented(app); end # source://actionpack//lib/action_dispatch/middleware/stack.rb#28 def inspect; end # Returns the value of attribute klass. # # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 def klass; end # source://actionpack//lib/action_dispatch/middleware/stack.rb#17 def name; end end # source://actionpack//lib/action_dispatch.rb#43 class ActionDispatch::MissingController < ::NameError; end # Configures the HTTP # {Feature-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy] # response header to specify which browser features the current document and # its iframes can use. # # Example global policy: # # Rails.application.config.permissions_policy do |policy| # policy.camera :none # policy.gyroscope :none # policy.microphone :none # policy.usb :none # policy.fullscreen :self # policy.payment :self, "https://secure.example.com" # end # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#22 class ActionDispatch::PermissionsPolicy # @return [PermissionsPolicy] a new instance of PermissionsPolicy # @yield [_self] # @yieldparam _self [ActionDispatch::PermissionsPolicy] the object that the method was called on # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#113 def initialize; end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def accelerometer(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def ambient_light_sensor(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def autoplay(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#132 def build(context = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def camera(*sources); end # Returns the value of attribute directives. # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#111 def directives; end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def encrypted_media(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def fullscreen(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def geolocation(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def gyroscope(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def magnetometer(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def microphone(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def midi(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def payment(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def picture_in_picture(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def speaker(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def usb(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def vibrate(*sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 def vr(*sources); end private # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#150 def apply_mapping(source); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#137 def apply_mappings(sources); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#168 def build_directive(sources, context); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#156 def build_directives(context); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#118 def initialize_copy(other); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#172 def resolve_source(source, context); end end # List of available permissions can be found at # https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md#policy-controlled-features # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#89 ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#82 ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#23 class ActionDispatch::PermissionsPolicy::Middleware # @return [Middleware] a new instance of Middleware # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#32 def initialize(app); end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#36 def call(env); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#55 def html_response?(headers); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#65 def policy_empty?(policy); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#61 def policy_present?(headers); end end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#24 ActionDispatch::PermissionsPolicy::Middleware::CONTENT_TYPE = T.let(T.unsafe(nil), String) # The Feature-Policy header has been renamed to Permissions-Policy. # The Permissions-Policy requires a different implementation and isn't # yet supported by all browsers. To avoid having to rename this # middleware in the future we use the new name for the middleware but # keep the old header name and implementation for now. # # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#30 ActionDispatch::PermissionsPolicy::Middleware::POLICY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#70 module ActionDispatch::PermissionsPolicy::Request # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#73 def permissions_policy; end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#77 def permissions_policy=(policy); end end # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#71 ActionDispatch::PermissionsPolicy::Request::POLICY = T.let(T.unsafe(nil), String) # When called, this middleware renders an error page. By default if an HTML # response is expected it will render static error pages from the /public # directory. For example when this middleware receives a 500 response it will # render the template found in /public/500.html. # If an internationalized locale is set, this middleware will attempt to render # the template in /public/500..html. If an internationalized template # is not found it will fall back on /public/500.html. # # When a request with a content type other than HTML is made, this middleware # will attempt to convert error information into the appropriate response type. # # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#14 class ActionDispatch::PublicExceptions # @return [PublicExceptions] a new instance of PublicExceptions # # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#17 def initialize(public_path); end # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#21 def call(env); end # Returns the value of attribute public_path. # # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#15 def public_path; end # Sets the attribute public_path # # @param value the value to set the attribute public_path to. # # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#15 def public_path=(_arg0); end private # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#35 def render(status, content_type, body); end # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#44 def render_format(status, content_type, body); end # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#49 def render_html(status); end end # source://actionpack//lib/action_dispatch/railtie.rb#7 class ActionDispatch::Railtie < ::Rails::Railtie; end # ActionDispatch::Reloader wraps the request with callbacks provided by ActiveSupport::Reloader # callbacks, intended to assist with code reloading during development. # # By default, ActionDispatch::Reloader is included in the middleware stack # only in the development environment; specifically, when +config.cache_classes+ # is false. # # source://actionpack//lib/action_dispatch/middleware/reloader.rb#10 class ActionDispatch::Reloader < ::ActionDispatch::Executor; end # This middleware calculates the IP address of the remote client that is # making the request. It does this by checking various headers that could # contain the address, and then picking the last-set address that is not # on the list of trusted IPs. This follows the precedent set by e.g. # {the Tomcat server}[https://issues.apache.org/bugzilla/show_bug.cgi?id=50453], # with {reasoning explained at length}[https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection] # by @gingerlime. A more detailed explanation of the algorithm is given # at GetIp#calculate_ip. # # Some Rack servers concatenate repeated headers, like {HTTP RFC 2616}[https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2] # requires. Some Rack servers simply drop preceding headers, and only report # the value that was {given in the last header}[https://andre.arko.net/2011/12/26/repeated-headers-and-ruby-web-servers]. # If you are behind multiple proxy servers (like NGINX to HAProxy to Unicorn) # then you should test your Rack server to make sure your data is good. # # IF YOU DON'T USE A PROXY, THIS MAKES YOU VULNERABLE TO IP SPOOFING. # This middleware assumes that there is at least one proxy sitting around # and setting headers with the client's remote IP address. If you don't use # a proxy, because you are hosted on e.g. Heroku without SSL, any client can # claim to have any IP address by setting the X-Forwarded-For header. If you # care about that, then you need to explicitly drop or ignore those headers # sometime before this middleware runs. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#28 class ActionDispatch::RemoteIp # Create a new +RemoteIp+ middleware instance. # # The +ip_spoofing_check+ option is on by default. When on, an exception # is raised if it looks like the client is trying to lie about its own IP # address. It makes sense to turn off this check on sites aimed at non-IP # clients (like WAP devices), or behind proxies that set headers in an # incorrect or confusing way (like AWS ELB). # # The +custom_proxies+ argument can take an enumerable which will be used # instead of +TRUSTED_PROXIES+. Any proxy setup will put the value you # want in the middle (or at the beginning) of the X-Forwarded-For list, # with your proxy servers after it. If your proxies aren't removed, pass # them in via the +custom_proxies+ parameter. That way, the middleware will # ignore those IP addresses, and return the one that you want. # # @return [RemoteIp] a new instance of RemoteIp # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#60 def initialize(app, ip_spoofing_check = T.unsafe(nil), custom_proxies = T.unsafe(nil)); end # Since the IP address may not be needed, we store the object here # without calculating the IP to keep from slowing down the majority of # requests. For those requests that do need to know the IP, the # GetIp#calculate_ip method will calculate the memoized client IP address. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#90 def call(env); end # Returns the value of attribute check_ip. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#44 def check_ip; end # Returns the value of attribute proxies. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#44 def proxies; end end # The GetIp class exists as a way to defer processing of the request data # into an actual IP address. If the ActionDispatch::Request#remote_ip method # is called, this class will calculate the value and then memoize it. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#99 class ActionDispatch::RemoteIp::GetIp # @return [GetIp] a new instance of GetIp # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#100 def initialize(req, check_ip, proxies); end # Sort through the various IP address headers, looking for the IP most # likely to be the address of the actual remote client making this # request. # # REMOTE_ADDR will be correct if the request is made directly against the # Ruby process, on e.g. Heroku. When the request is proxied by another # server like HAProxy or NGINX, the IP address that made the original # request will be put in an X-Forwarded-For header. If there are multiple # proxies, that header may contain a list of IPs. Other proxy services # set the Client-Ip header instead, so we check that too. # # As discussed in {this post about Rails IP Spoofing}[https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/], # while the first IP in the list is likely to be the "originating" IP, # it could also have been set by the client maliciously. # # In order to find the first address that is (probably) accurate, we # take the list of IPs, remove known and trusted proxies, and then take # the last address left, which was presumably set by one of those proxies. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#124 def calculate_ip; end # Memoizes the value returned by #calculate_ip and returns it for # ActionDispatch::Request to use. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#167 def to_s; end private # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#186 def filter_proxies(ips); end # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#172 def ips_from(header); end end # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#29 class ActionDispatch::RemoteIp::IpSpoofAttackError < ::StandardError; end # The default trusted IPs list simply includes IP addresses that are # guaranteed by the IP specification to be private addresses. Those will # not be the ultimate client IP in production, and so are discarded. See # https://en.wikipedia.org/wiki/Private_network for details. # # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#35 ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#18 class ActionDispatch::Request include ::ActionDispatch::Flash::RequestMethods include ::Rack::Request::Helpers include ::ActionDispatch::Http::Cache::Request include ::ActionDispatch::Http::MimeNegotiation include ::ActionDispatch::Http::Parameters include ::ActionDispatch::Http::FilterParameters include ::ActionDispatch::Http::URL include ::ActionDispatch::ContentSecurityPolicy::Request include ::ActionDispatch::PermissionsPolicy::Request include ::Rack::Request::Env include ::ActionDispatch::RequestCookieMethods extend ::ActionDispatch::Http::Parameters::ClassMethods # @return [Request] a new instance of Request # # source://actionpack//lib/action_dispatch/http/request.rb#60 def initialize(env); end # Override Rack's GET method to support indifferent access. # # source://actionpack//lib/action_dispatch/http/request.rb#372 def GET; end # Override Rack's POST method to support indifferent access. # # source://actionpack//lib/action_dispatch/http/request.rb#388 def POST; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def accept; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def accept_charset; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def accept_encoding; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def accept_language; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def auth_type; end # Returns the authorization header regardless of whether it was specified directly or through one of the # proxy alternatives. # # source://actionpack//lib/action_dispatch/http/request.rb#404 def authorization; end # The request body is an IO input stream. If the RAW_POST_DATA environment # variable is already set, wrap it in a StringIO. # # source://actionpack//lib/action_dispatch/http/request.rb#334 def body; end # source://actionpack//lib/action_dispatch/http/request.rb#355 def body_stream; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def cache_control; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def client_ip; end # source://actionpack//lib/action_dispatch/http/request.rb#70 def commit_cookie_jar!; end # source://actionpack//lib/action_dispatch/middleware/flash.rb#62 def commit_flash; end # Returns the content length of the request as an integer. # # source://actionpack//lib/action_dispatch/http/request.rb#270 def content_length; end # source://actionpack//lib/action_dispatch/http/request.rb#79 def controller_class; end # source://actionpack//lib/action_dispatch/http/request.rb#85 def controller_class_for(name); end # source://actionpack//lib/action_dispatch/http/request.rb#171 def controller_instance; end # source://actionpack//lib/action_dispatch/http/request.rb#175 def controller_instance=(controller); end # source://actionpack//lib/action_dispatch/http/request.rb#157 def engine_script_name(_routes); end # source://actionpack//lib/action_dispatch/http/request.rb#161 def engine_script_name=(name); end # Determine whether the request body contains form-data by checking # the request Content-Type for one of the media-types: # "application/x-www-form-urlencoded" or "multipart/form-data". The # list of form-data media types can be modified through the # +FORM_DATA_MEDIA_TYPES+ array. # # A request body is not assumed to contain form-data when no # Content-Type header is provided and the request_method is POST. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#351 def form_data?; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def from; end # Returns the +String+ full path including params of the last URL requested. # # # get "/articles" # request.fullpath # => "/articles" # # # get "/articles?page=2" # request.fullpath # => "/articles?page=2" # # source://actionpack//lib/action_dispatch/http/request.rb#249 def fullpath; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def gateway_interface; end # Provides access to the request's HTTP headers, for example: # # request.headers["Content-Type"] # => "text/plain" # # source://actionpack//lib/action_dispatch/http/request.rb#210 def headers; end # source://actionpack//lib/action_dispatch/http/request.rb#179 def http_auth_salt; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 def ignore_accept_header; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 def ignore_accept_header=(val); end # source://actionpack//lib/action_dispatch/http/request.rb#428 def inspect; end # Returns the IP address of client as a +String+. # # source://actionpack//lib/action_dispatch/http/request.rb#283 def ip; end # Returns true if the request has a header matching the given key parameter. # # request.key? :ip_spoofing_check # => true # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#106 def key?(key); end # True if the request came from localhost, 127.0.0.1, or ::1. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#412 def local?; end # source://actionpack//lib/action_dispatch/http/request.rb#421 def logger; end # The +String+ MIME type of the request. # # # get "/articles" # request.media_type # => "application/x-www-form-urlencoded" # # source://actionpack//lib/action_dispatch/http/request.rb#265 def media_type; end # Returns the original value of the environment's REQUEST_METHOD, # even if it was overridden by middleware. See #request_method for # more information. # # source://actionpack//lib/action_dispatch/http/request.rb#198 def method; end # Returns a symbol form of the #method. # # source://actionpack//lib/action_dispatch/http/request.rb#203 def method_symbol; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def negotiate; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def origin; end # Returns a +String+ with the last requested path including their params. # # # get '/foo' # request.original_fullpath # => '/foo' # # # get '/foo?bar' # request.original_fullpath # => '/foo?bar' # # source://actionpack//lib/action_dispatch/http/request.rb#238 def original_fullpath; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def original_script_name; end # Returns the original request URL as a +String+. # # # get "/articles?page=2" # request.original_url # => "http://www.example.com/articles?page=2" # # source://actionpack//lib/action_dispatch/http/request.rb#257 def original_url; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def path_translated; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def pragma; end # Override Rack's GET method to support indifferent access. # # source://actionpack//lib/action_dispatch/http/request.rb#372 def query_parameters; end # Read the request \body. This is useful for web services that need to # work with raw requests directly. # # source://actionpack//lib/action_dispatch/http/request.rb#323 def raw_post; end # source://rack/2.2.6.4/lib/rack/request.rb#157 def raw_request_method; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def remote_addr; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def remote_host; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def remote_ident; end # Returns the IP address of client as a +String+, # usually set by the RemoteIp middleware. # # source://actionpack//lib/action_dispatch/http/request.rb#289 def remote_ip; end # source://actionpack//lib/action_dispatch/http/request.rb#293 def remote_ip=(remote_ip); end # source://actionpack//lib/action_dispatch/http/request.rb#50 def remote_user; end # Returns the unique request id, which is based on either the X-Request-Id header that can # be generated by a firewall, load balancer, or web server, or by the RequestId middleware # (which sets the +action_dispatch.request_id+ environment variable). # # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. # # source://actionpack//lib/action_dispatch/http/request.rb#306 def request_id; end # source://actionpack//lib/action_dispatch/http/request.rb#310 def request_id=(id); end # Returns the HTTP \method that the application should see. # In the case where the \method was overridden by a middleware # (for instance, if a HEAD request was converted to a GET, # or if a _method parameter was used to determine the \method # the application should use), this \method returns the overridden # value, not the original. # # source://actionpack//lib/action_dispatch/http/request.rb#145 def request_method; end # source://actionpack//lib/action_dispatch/http/request.rb#165 def request_method=(request_method); end # Returns a symbol form of the #request_method. # # source://actionpack//lib/action_dispatch/http/request.rb#191 def request_method_symbol; end # Override Rack's POST method to support indifferent access. # # source://actionpack//lib/action_dispatch/http/request.rb#388 def request_parameters; end # source://actionpack//lib/action_dispatch/http/request.rb#416 def request_parameters=(params); end # source://actionpack//lib/action_dispatch/middleware/flash.rb#75 def reset_session; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 def return_only_media_type_on_content_type; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 def return_only_media_type_on_content_type=(val); end # source://actionpack//lib/action_dispatch/http/request.rb#149 def routes; end # source://actionpack//lib/action_dispatch/http/request.rb#153 def routes=(routes); end # Early Hints is an HTTP/2 status code that indicates hints to help a client start # making preparations for processing the final response. # # If the env contains +rack.early_hints+ then the server accepts HTTP2 push for Link headers. # # The +send_early_hints+ method accepts a hash of links as follows: # # send_early_hints("Link" => "; rel=preload; as=style\n; rel=preload") # # If you are using +javascript_include_tag+ or +stylesheet_link_tag+ the # Early Hints headers are included by default if supported. # # source://actionpack//lib/action_dispatch/http/request.rb#225 def send_early_hints(links); end # source://actionpack//lib/action_dispatch/http/request.rb#50 def server_name; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def server_protocol; end # Returns the lowercase name of the HTTP server software. # # source://actionpack//lib/action_dispatch/http/request.rb#317 def server_software; end # source://actionpack//lib/action_dispatch/http/request.rb#363 def session=(session); end # source://actionpack//lib/action_dispatch/http/request.rb#367 def session_options=(options); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#183 def show_exceptions?; end # Returns the unique request id, which is based on either the X-Request-Id header that can # be generated by a firewall, load balancer, or web server, or by the RequestId middleware # (which sets the +action_dispatch.request_id+ environment variable). # # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. # # source://actionpack//lib/action_dispatch/http/request.rb#306 def uuid; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def version; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def x_csrf_token; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def x_forwarded_for; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def x_forwarded_host; end # source://actionpack//lib/action_dispatch/http/request.rb#50 def x_request_id; end # Returns true if the "X-Requested-With" header contains "XMLHttpRequest" # (case-insensitive), which may need to be manually added depending on the # choice of JavaScript libraries and frameworks. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#277 def xhr?; end # Returns true if the "X-Requested-With" header contains "XMLHttpRequest" # (case-insensitive), which may need to be manually added depending on the # choice of JavaScript libraries and frameworks. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/request.rb#277 def xml_http_request?; end private # source://actionpack//lib/action_dispatch/http/request.rb#433 def check_method(name); end # source://actionpack//lib/action_dispatch/http/request.rb#438 def default_session; end class << self # source://actionpack//lib/action_dispatch/http/request.rb#56 def empty; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 def ignore_accept_header; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 def ignore_accept_header=(val); end # source://actionpack//lib/action_dispatch/http/parameters.rb#28 def parameter_parsers; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 def return_only_media_type_on_content_type; end # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 def return_only_media_type_on_content_type=(val); end end end # source://actionpack//lib/action_dispatch/http/request.rb#298 ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/request.rb#34 ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#128 ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#130 ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/request.rb#32 ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/request.rb#73 class ActionDispatch::Request::PASS_NOT_FOUND class << self # source://actionpack//lib/action_dispatch/http/request.rb#74 def action(_); end # source://actionpack//lib/action_dispatch/http/request.rb#76 def action_encoding_template(action); end # source://actionpack//lib/action_dispatch/http/request.rb#75 def call(_); end end end # source://actionpack//lib/action_dispatch/http/request.rb#120 ActionDispatch::Request::RFC2518 = T.let(T.unsafe(nil), Array) # List of HTTP request methods from the following RFCs: # Hypertext Transfer Protocol -- HTTP/1.1 (https://www.ietf.org/rfc/rfc2616.txt) # HTTP Extensions for Distributed Authoring -- WEBDAV (https://www.ietf.org/rfc/rfc2518.txt) # Versioning Extensions to WebDAV (https://www.ietf.org/rfc/rfc3253.txt) # Ordered Collections Protocol (WebDAV) (https://www.ietf.org/rfc/rfc3648.txt) # Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol (https://www.ietf.org/rfc/rfc3744.txt) # Web Distributed Authoring and Versioning (WebDAV) SEARCH (https://www.ietf.org/rfc/rfc5323.txt) # Calendar Extensions to WebDAV (https://www.ietf.org/rfc/rfc4791.txt) # PATCH Method for HTTP (https://www.ietf.org/rfc/rfc5789.txt) # # source://actionpack//lib/action_dispatch/http/request.rb#119 ActionDispatch::Request::RFC2616 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#121 ActionDispatch::Request::RFC3253 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#122 ActionDispatch::Request::RFC3648 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#123 ActionDispatch::Request::RFC3744 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#125 ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#124 ActionDispatch::Request::RFC5323 = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/request.rb#126 ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) # Session is responsible for lazily loading the session from store. # # source://actionpack//lib/action_dispatch/request/session.rb#8 class ActionDispatch::Request::Session # @return [Session] a new instance of Session # # source://actionpack//lib/action_dispatch/request/session.rb#74 def initialize(by, req, enabled: T.unsafe(nil)); end # Returns value of the key stored in the session or # +nil+ if the given key is not found in the session. # # source://actionpack//lib/action_dispatch/request/session.rb#110 def [](key); end # Writes given value to given key of the session. # # source://actionpack//lib/action_dispatch/request/session.rb#150 def []=(key, value); end # Clears the session. # # source://actionpack//lib/action_dispatch/request/session.rb#156 def clear; end # Deletes given key from the session. # # source://actionpack//lib/action_dispatch/request/session.rb#184 def delete(key); end # source://actionpack//lib/action_dispatch/request/session.rb#95 def destroy; end # Returns the nested value specified by the sequence of keys, returning # +nil+ if any intermediate step is +nil+. # # source://actionpack//lib/action_dispatch/request/session.rb#123 def dig(*keys); end # source://actionpack//lib/action_dispatch/request/session.rb#240 def each(&block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#230 def empty?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#87 def enabled?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#220 def exists?; end # Returns value of the given key from the session, or raises +KeyError+ # if can't find the given key and no default value is set. # Returns default value if specified. # # session.fetch(:foo) # # => KeyError: key not found: "foo" # # session.fetch(:foo, :bar) # # => :bar # # session.fetch(:foo) do # :bar # end # # => :bar # # source://actionpack//lib/action_dispatch/request/session.rb#203 def fetch(key, default = T.unsafe(nil), &block); end # Returns true if the session has the given key or false. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#130 def has_key?(key); end # source://actionpack//lib/action_dispatch/request/session.rb#83 def id; end # Returns true if the session has the given key or false. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#130 def include?(key); end # source://actionpack//lib/action_dispatch/request/session.rb#212 def inspect; end # Returns true if the session has the given key or false. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#130 def key?(key); end # Returns keys of the session as Array. # # source://actionpack//lib/action_dispatch/request/session.rb#138 def keys; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/request/session.rb#226 def loaded?; end # source://actionpack//lib/action_dispatch/request/session.rb#235 def merge!(other); end # source://actionpack//lib/action_dispatch/request/session.rb#91 def options; end # Returns the session as Hash. # # source://actionpack//lib/action_dispatch/request/session.rb#162 def to_h; end # Returns the session as Hash. # # source://actionpack//lib/action_dispatch/request/session.rb#162 def to_hash; end # Updates the session with given Hash. # # session.to_hash # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} # # session.update({ "foo" => "bar" }) # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} # # session.to_hash # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} # # source://actionpack//lib/action_dispatch/request/session.rb#178 def update(hash); end # Returns values of the session as Array. # # source://actionpack//lib/action_dispatch/request/session.rb#144 def values; end private # source://actionpack//lib/action_dispatch/request/session.rb#261 def load!; end # source://actionpack//lib/action_dispatch/request/session.rb#257 def load_for_delete!; end # source://actionpack//lib/action_dispatch/request/session.rb#245 def load_for_read!; end # source://actionpack//lib/action_dispatch/request/session.rb#249 def load_for_write!; end class << self # Creates a session hash, merging the properties of the previous session if any. # # source://actionpack//lib/action_dispatch/request/session.rb#17 def create(store, req, default_options); end # source://actionpack//lib/action_dispatch/request/session.rb#41 def delete(req); end # source://actionpack//lib/action_dispatch/request/session.rb#27 def disabled(req); end # source://actionpack//lib/action_dispatch/request/session.rb#33 def find(req); end # source://actionpack//lib/action_dispatch/request/session.rb#37 def set(req, session); end end end # source://actionpack//lib/action_dispatch/request/session.rb#9 class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end # source://actionpack//lib/action_dispatch/request/session.rb#10 ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/request/session.rb#11 ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/request/session.rb#45 class ActionDispatch::Request::Session::Options # @return [Options] a new instance of Options # # source://actionpack//lib/action_dispatch/request/session.rb#54 def initialize(by, default_options); end # source://actionpack//lib/action_dispatch/request/session.rb#59 def [](key); end # source://actionpack//lib/action_dispatch/request/session.rb#69 def []=(k, v); end # source://actionpack//lib/action_dispatch/request/session.rb#63 def id(req); end # source://actionpack//lib/action_dispatch/request/session.rb#70 def to_hash; end # source://actionpack//lib/action_dispatch/request/session.rb#71 def values_at(*args); end class << self # source://actionpack//lib/action_dispatch/request/session.rb#50 def find(req); end # source://actionpack//lib/action_dispatch/request/session.rb#46 def set(req, options); end end end # Singleton object used to determine if an optional param wasn't specified. # # source://actionpack//lib/action_dispatch/request/session.rb#14 ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) # source://actionpack//lib/action_dispatch/request/utils.rb#7 class ActionDispatch::Request::Utils # source://actionpack//lib/action_dispatch/request/utils.rb#8 def perform_deep_munge; end # source://actionpack//lib/action_dispatch/request/utils.rb#8 def perform_deep_munge=(val); end class << self # source://actionpack//lib/action_dispatch/request/utils.rb#29 def check_param_encoding(params); end # source://actionpack//lib/action_dispatch/request/utils.rb#10 def each_param_value(params, &block); end # source://actionpack//lib/action_dispatch/request/utils.rb#21 def normalize_encode_params(params); end # source://actionpack//lib/action_dispatch/request/utils.rb#8 def perform_deep_munge; end # source://actionpack//lib/action_dispatch/request/utils.rb#8 def perform_deep_munge=(val); end # source://actionpack//lib/action_dispatch/request/utils.rb#44 def set_binary_encoding(request, params, controller, action); end end end # source://actionpack//lib/action_dispatch/request/utils.rb#81 class ActionDispatch::Request::Utils::CustomParamEncoder class << self # source://actionpack//lib/action_dispatch/request/utils.rb#94 def action_encoding_template(request, controller, action); end # source://actionpack//lib/action_dispatch/request/utils.rb#82 def encode(request, params, controller, action); end end end # Remove nils from the params hash. # # source://actionpack//lib/action_dispatch/request/utils.rb#73 class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder class << self # source://actionpack//lib/action_dispatch/request/utils.rb#74 def handle_array(params); end end end # source://actionpack//lib/action_dispatch/request/utils.rb#48 class ActionDispatch::Request::Utils::ParamEncoder class << self # source://actionpack//lib/action_dispatch/request/utils.rb#67 def handle_array(params); end # Convert nested Hash to HashWithIndifferentAccess. # # source://actionpack//lib/action_dispatch/request/utils.rb#50 def normalize_encode_params(params); end end end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#10 module ActionDispatch::RequestCookieMethods # source://actionpack//lib/action_dispatch/middleware/cookies.rb#48 def authenticated_encrypted_cookie_salt; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#11 def cookie_jar; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#28 def cookie_jar=(jar); end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#76 def cookies_digest; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#80 def cookies_rotations; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#72 def cookies_same_site_protection; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#68 def cookies_serializer; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#56 def encrypted_cookie_cipher; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#40 def encrypted_cookie_salt; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#44 def encrypted_signed_cookie_salt; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/cookies.rb#24 def have_cookie_jar?; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#32 def key_generator; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#64 def secret_key_base; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#60 def signed_cookie_digest; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#36 def signed_cookie_salt; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#52 def use_authenticated_cookie_encryption; end # source://actionpack//lib/action_dispatch/middleware/cookies.rb#84 def use_cookies_with_metadata; end end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#4 class ActionDispatch::RequestEncoder # @return [RequestEncoder] a new instance of RequestEncoder # # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#16 def initialize(mime_name, param_encoder, response_parser); end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#32 def accept_header; end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#28 def content_type; end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#36 def encode_params(params); end # Returns the value of attribute response_parser. # # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#14 def response_parser; end class << self # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#45 def encoder(name); end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#40 def parser(content_type); end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#49 def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil)); end end end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#5 class ActionDispatch::RequestEncoder::IdentityEncoder # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#7 def accept_header; end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#6 def content_type; end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#8 def encode_params(params); end # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#9 def response_parser; end end # Makes a unique request id available to the +action_dispatch.request_id+ env variable (which is then accessible # through ActionDispatch::Request#request_id or the alias ActionDispatch::Request#uuid) and sends # the same id to the client via the X-Request-Id header. # # The unique request id is either based on the X-Request-Id header in the request, which would typically be generated # by a firewall, load balancer, or the web server, or, if this header is not available, a random uuid. If the # header is accepted from the outside world, we sanitize it to a max of 255 chars and alphanumeric and dashes only. # # The unique request id can be used to trace a request end-to-end and would typically end up being part of log files # from multiple pieces of the stack. # # source://actionpack//lib/action_dispatch/middleware/request_id.rb#17 class ActionDispatch::RequestId # @return [RequestId] a new instance of RequestId # # source://actionpack//lib/action_dispatch/middleware/request_id.rb#18 def initialize(app, header:); end # source://actionpack//lib/action_dispatch/middleware/request_id.rb#23 def call(env); end private # source://actionpack//lib/action_dispatch/middleware/request_id.rb#38 def internal_request_id; end # source://actionpack//lib/action_dispatch/middleware/request_id.rb#30 def make_request_id(request_id); end end # Represents an HTTP response generated by a controller action. Use it to # retrieve the current state of the response, or customize the response. It can # either represent a real HTTP response (i.e. one that is meant to be sent # back to the web browser) or a TestResponse (i.e. one that is generated # from integration tests). # # \Response is mostly a Ruby on \Rails framework implementation detail, and # should never be used directly in controllers. Controllers should use the # methods defined in ActionController::Base instead. For example, if you want # to set the HTTP response's content MIME type, then use # ActionControllerBase#headers instead of Response#headers. # # Nevertheless, integration tests may want to inspect controller responses in # more detail, and that's when \Response can be useful for application # developers. Integration test methods such as # Integration::RequestHelpers#get and Integration::RequestHelpers#post return # objects of type TestResponse (which are of course also of type \Response). # # For example, the following demo integration test prints the body of the # controller response to the console: # # class DemoControllerTest < ActionDispatch::IntegrationTest # def test_print_root_path_to_console # get('/') # puts response.body # end # end # # source://actionpack//lib/action_dispatch/http/response.rb#36 class ActionDispatch::Response include ::Rack::Response::Helpers include ::ActionDispatch::Http::FilterRedirect include ::ActionDispatch::Http::Cache::Response include ::MonitorMixin # @return [Response] a new instance of Response # @yield [_self] # @yieldparam _self [ActionDispatch::Response] the object that the method was called on # # source://actionpack//lib/action_dispatch/http/response.rb#161 def initialize(status = T.unsafe(nil), header = T.unsafe(nil), body = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/response.rb#71 def [](*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/http/response.rb#71 def []=(*_arg0, **_arg1, &_arg2); end # Aliasing these off because AD::Http::Cache::Response defines them. # # source://rack/2.2.6.4/lib/rack/response.rb#229 def _cache_control; end # source://rack/2.2.6.4/lib/rack/response.rb#233 def _cache_control=(v); end # source://actionpack//lib/action_dispatch/http/response.rb#370 def abort; end # source://actionpack//lib/action_dispatch/http/response.rb#183 def await_commit; end # source://actionpack//lib/action_dispatch/http/response.rb#189 def await_sent; end # Returns the content of the response as a string. This contains the contents # of any calls to render. # # source://actionpack//lib/action_dispatch/http/response.rb#304 def body; end # Allows you to manually set or override the response body. # # source://actionpack//lib/action_dispatch/http/response.rb#313 def body=(body); end # source://actionpack//lib/action_dispatch/http/response.rb#357 def body_parts; end # The charset of the response. HTML wants to know the encoding of the # content you're giving them, so we need to send that along. # # source://actionpack//lib/action_dispatch/http/response.rb#274 def charset; end # Sets the HTTP character set. In case of +nil+ parameter # it sets the charset to +default_charset+. # # response.charset = 'utf-16' # => 'utf-16' # response.charset = nil # => 'utf-8' # # source://actionpack//lib/action_dispatch/http/response.rb#263 def charset=(charset); end # source://actionpack//lib/action_dispatch/http/response.rb#366 def close; end # Returns a string to ensure compatibility with Net::HTTPResponse. # # source://actionpack//lib/action_dispatch/http/response.rb#285 def code; end # source://actionpack//lib/action_dispatch/http/response.rb#193 def commit!; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#217 def committed?; end # Content type of response. # # source://actionpack//lib/action_dispatch/http/response.rb#243 def content_type; end # Sets the HTTP response's content MIME type. For example, in the controller # you could write this: # # response.content_type = "text/plain" # # If a character set has been defined for this response (see charset=) then # the character set information will also be included in the content type # information. # # source://actionpack//lib/action_dispatch/http/response.rb#233 def content_type=(content_type); end # Returns the response cookies, converted to a Hash of (name => value) pairs # # assert_equal 'AuthorOfNewPage', r.cookies['author'] # # source://actionpack//lib/action_dispatch/http/response.rb#394 def cookies; end # source://actionpack//lib/action_dispatch/http/response.rb#85 def default_charset; end # source://actionpack//lib/action_dispatch/http/response.rb#85 def default_charset=(val); end # source://actionpack//lib/action_dispatch/http/response.rb#86 def default_headers; end # source://actionpack//lib/action_dispatch/http/response.rb#86 def default_headers=(val); end # source://actionpack//lib/action_dispatch/http/response.rb#181 def delete_header(key); end # source://actionpack//lib/action_dispatch/http/response.rb#73 def each(&block); end # source://actionpack//lib/action_dispatch/http/response.rb#179 def get_header(key); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#178 def has_header?(key); end # Get headers for this response. # # source://actionpack//lib/action_dispatch/http/response.rb#67 def header; end # Get headers for this response. # # source://actionpack//lib/action_dispatch/http/response.rb#67 def headers; end # Media type of response. # # source://actionpack//lib/action_dispatch/http/response.rb#248 def media_type; end # Returns the corresponding message for the current HTTP status code: # # response.status = 200 # response.message # => "OK" # # response.status = 404 # response.message # => "Not Found" # # source://actionpack//lib/action_dispatch/http/response.rb#297 def message; end # Turns the Response into a Rack-compatible array of the status, headers, # and body. Allows explicit splatting: # # status, headers, body = *response # # source://actionpack//lib/action_dispatch/http/response.rb#385 def prepare!; end # The location header we'll be responding with. # # source://rack/2.2.6.4/lib/rack/response.rb#204 def redirect_url; end # The request that the response is responding to. # # source://actionpack//lib/action_dispatch/http/response.rb#61 def request; end # The request that the response is responding to. # # source://actionpack//lib/action_dispatch/http/response.rb#61 def request=(_arg0); end # source://actionpack//lib/action_dispatch/http/response.rb#353 def reset_body!; end # The response code of the request. # # source://actionpack//lib/action_dispatch/http/response.rb#280 def response_code; end # Send the file stored at +path+ as the response body. # # source://actionpack//lib/action_dispatch/http/response.rb#348 def send_file(path); end # source://actionpack//lib/action_dispatch/http/response.rb#201 def sending!; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#216 def sending?; end # source://actionpack//lib/action_dispatch/http/response.rb#252 def sending_file=(v); end # source://actionpack//lib/action_dispatch/http/response.rb#209 def sent!; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#218 def sent?; end # source://actionpack//lib/action_dispatch/http/response.rb#180 def set_header(key, v); end # The HTTP status code. # # source://actionpack//lib/action_dispatch/http/response.rb#64 def status; end # Sets the HTTP status code. # # source://actionpack//lib/action_dispatch/http/response.rb#221 def status=(status); end # Returns the corresponding message for the current HTTP status code: # # response.status = 200 # response.message # => "OK" # # response.status = 404 # response.message # => "Not Found" # # source://actionpack//lib/action_dispatch/http/response.rb#297 def status_message; end # The underlying body, as a streamable object. # # source://actionpack//lib/action_dispatch/http/response.rb#159 def stream; end # Turns the Response into a Rack-compatible array of the status, headers, # and body. Allows explicit splatting: # # status, headers, body = *response # # source://actionpack//lib/action_dispatch/http/response.rb#385 def to_a; end # source://actionpack//lib/action_dispatch/http/response.rb#308 def write(string); end private # source://actionpack//lib/action_dispatch/http/response.rb#466 def assign_default_content_type_and_charset!; end # source://actionpack//lib/action_dispatch/http/response.rb#438 def before_committed; end # source://actionpack//lib/action_dispatch/http/response.rb#446 def before_sending; end # source://actionpack//lib/action_dispatch/http/response.rb#458 def build_buffer(response, body); end # source://actionpack//lib/action_dispatch/http/response.rb#510 def handle_no_content!; end # source://actionpack//lib/action_dispatch/http/response.rb#462 def munge_body_object(body); end # source://actionpack//lib/action_dispatch/http/response.rb#418 def parse_content_type(content_type); end # Small internal convenience method to get the parsed version of the current # content type header. # # source://actionpack//lib/action_dispatch/http/response.rb#428 def parsed_content_type_header; end # source://actionpack//lib/action_dispatch/http/response.rb#517 def rack_response(status, header); end # source://actionpack//lib/action_dispatch/http/response.rb#432 def set_content_type(content_type, charset); end class << self # source://actionpack//lib/action_dispatch/http/response.rb#149 def create(status = T.unsafe(nil), header = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/response.rb#85 def default_charset; end # source://actionpack//lib/action_dispatch/http/response.rb#85 def default_charset=(val); end # source://actionpack//lib/action_dispatch/http/response.rb#86 def default_headers; end # source://actionpack//lib/action_dispatch/http/response.rb#86 def default_headers=(val); end # source://actionpack//lib/action_dispatch/http/response.rb#154 def merge_default_headers(original, default); end end end # source://actionpack//lib/action_dispatch/http/response.rb#97 class ActionDispatch::Response::Buffer # @return [Buffer] a new instance of Buffer # # source://actionpack//lib/action_dispatch/http/response.rb#98 def initialize(response, buf); end # source://actionpack//lib/action_dispatch/http/response.rb#131 def abort; end # source://actionpack//lib/action_dispatch/http/response.rb#105 def body; end # source://actionpack//lib/action_dispatch/http/response.rb#134 def close; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#139 def closed?; end # source://actionpack//lib/action_dispatch/http/response.rb#121 def each(&block); end # @raise [IOError] # # source://actionpack//lib/action_dispatch/http/response.rb#113 def write(string); end private # source://actionpack//lib/action_dispatch/http/response.rb#144 def each_chunk(&block); end end # source://actionpack//lib/action_dispatch/http/response.rb#80 ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/response.rb#412 ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/http/response.rb#409 class ActionDispatch::Response::ContentTypeHeader < ::Struct # Returns the value of attribute charset # # @return [Object] the current value of charset def charset; end # Sets the attribute charset # # @param value [Object] the value to set the attribute charset to. # @return [Object] the newly set value def charset=(_); end # Returns the value of attribute mime_type # # @return [Object] the current value of mime_type def mime_type; end # Sets the attribute mime_type # # @param value [Object] the value to set the attribute mime_type to. # @return [Object] the newly set value def mime_type=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # Avoid having to pass an open file handle as the response body. # Rack::Sendfile will usually intercept the response and uses # the path directly, so there is no reason to open the file. # # source://actionpack//lib/action_dispatch/http/response.rb#326 class ActionDispatch::Response::FileBody # @return [FileBody] a new instance of FileBody # # source://actionpack//lib/action_dispatch/http/response.rb#329 def initialize(path); end # source://actionpack//lib/action_dispatch/http/response.rb#333 def body; end # Stream the file's contents if Rack::Sendfile isn't present. # # source://actionpack//lib/action_dispatch/http/response.rb#338 def each; end # source://actionpack//lib/action_dispatch/http/response.rb#327 def to_path; end end # source://actionpack//lib/action_dispatch/http/response.rb#37 class ActionDispatch::Response::Header # @return [Header] a new instance of Header # # source://actionpack//lib/action_dispatch/http/response.rb#38 def initialize(response, header); end # source://actionpack//lib/action_dispatch/http/response.rb#43 def []=(k, v); end # source://actionpack//lib/action_dispatch/http/response.rb#51 def merge(other); end # source://actionpack//lib/action_dispatch/http/response.rb#55 def to_hash; end end # source://actionpack//lib/action_dispatch/http/response.rb#82 ActionDispatch::Response::LOCATION = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/response.rb#83 ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/http/response.rb#410 ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) # source://actionpack//lib/action_dispatch/http/response.rb#474 class ActionDispatch::Response::RackBody # @return [RackBody] a new instance of RackBody # # source://actionpack//lib/action_dispatch/http/response.rb#475 def initialize(response); end # source://actionpack//lib/action_dispatch/http/response.rb#489 def body; end # source://actionpack//lib/action_dispatch/http/response.rb#483 def close; end # source://actionpack//lib/action_dispatch/http/response.rb#479 def each(*args, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/response.rb#493 def respond_to?(method, include_private = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/response.rb#505 def to_ary; end # source://actionpack//lib/action_dispatch/http/response.rb#501 def to_path; end end # source://actionpack//lib/action_dispatch/http/response.rb#81 ActionDispatch::Response::SET_COOKIE = T.let(T.unsafe(nil), String) # The routing module provides URL rewriting in native Ruby. It's a way to # redirect incoming requests to controllers and actions. This replaces # mod_rewrite rules. Best of all, Rails' \Routing works with any web server. # Routes are defined in config/routes.rb. # # Think of creating routes as drawing a map for your requests. The map tells # them where to go based on some predefined pattern: # # Rails.application.routes.draw do # Pattern 1 tells some request to go to one place # Pattern 2 tell them to go to another # ... # end # # The following symbols are special: # # :controller maps to your controller name # :action maps to an action with your controllers # # Other names simply map to a parameter as in the case of :id. # # == Resources # # Resource routing allows you to quickly declare all of the common routes # for a given resourceful controller. Instead of declaring separate routes # for your +index+, +show+, +new+, +edit+, +create+, +update+, and +destroy+ # actions, a resourceful route declares them in a single line of code: # # resources :photos # # Sometimes, you have a resource that clients always look up without # referencing an ID. A common example, /profile always shows the profile of # the currently logged in user. In this case, you can use a singular resource # to map /profile (rather than /profile/:id) to the show action. # # resource :profile # # It's common to have resources that are logically children of other # resources: # # resources :magazines do # resources :ads # end # # You may wish to organize groups of controllers under a namespace. Most # commonly, you might group a number of administrative controllers under # an +admin+ namespace. You would place these controllers under the # app/controllers/admin directory, and you can group them together # in your router: # # namespace "admin" do # resources :posts, :comments # end # # Alternatively, you can add prefixes to your path without using a separate # directory by using +scope+. +scope+ takes additional options which # apply to all enclosed routes. # # scope path: "/cpanel", as: 'admin' do # resources :posts, :comments # end # # For more, see Routing::Mapper::Resources#resources, # Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope. # # == Non-resourceful routes # # For routes that don't fit the resources mold, you can use the HTTP helper # methods get, post, patch, put and delete. # # get 'post/:id', to: 'posts#show' # post 'post/:id', to: 'posts#create_comment' # # Now, if you POST to /posts/:id, it will route to the create_comment action. A GET on the same # URL will route to the show action. # # If your route needs to respond to more than one HTTP method (or all methods) then using the # :via option on match is preferable. # # match 'post/:id', to: 'posts#show', via: [:get, :post] # # == Named routes # # Routes can be named by passing an :as option, # allowing for easy reference within your source as +name_of_route_url+ # for the full URL and +name_of_route_path+ for the URI path. # # Example: # # # In config/routes.rb # get '/login', to: 'accounts#login', as: 'login' # # # With render, redirect_to, tests, etc. # redirect_to login_url # # Arguments can be passed as well. # # redirect_to show_item_path(id: 25) # # Use root as a shorthand to name a route for the root path "/". # # # In config/routes.rb # root to: 'blogs#index' # # # would recognize http://www.example.com/ as # params = { controller: 'blogs', action: 'index' } # # # and provide these named routes # root_url # => 'http://www.example.com/' # root_path # => '/' # # Note: when using +controller+, the route is simply named after the # method you call on the block parameter rather than map. # # # In config/routes.rb # controller :blog do # get 'blog/show', to: :list # get 'blog/delete', to: :delete # get 'blog/edit', to: :edit # end # # # provides named routes for show, delete, and edit # link_to @article.title, blog_show_path(id: @article.id) # # == Pretty URLs # # Routes can generate pretty URLs. For example: # # get '/articles/:year/:month/:day', to: 'articles#find_by_id', constraints: { # year: /\d{4}/, # month: /\d{1,2}/, # day: /\d{1,2}/ # } # # Using the route above, the URL "http://localhost:3000/articles/2005/11/06" # maps to # # params = {year: '2005', month: '11', day: '06'} # # == Regular Expressions and parameters # You can specify a regular expression to define a format for a parameter. # # controller 'geocode' do # get 'geocode/:postalcode', to: :show, constraints: { # postalcode: /\d{5}(-\d{4})?/ # } # end # # Constraints can include the 'ignorecase' and 'extended syntax' regular # expression modifiers: # # controller 'geocode' do # get 'geocode/:postalcode', to: :show, constraints: { # postalcode: /hx\d\d\s\d[a-z]{2}/i # } # end # # controller 'geocode' do # get 'geocode/:postalcode', to: :show, constraints: { # postalcode: /# Postalcode format # \d{5} #Prefix # (-\d{4})? #Suffix # /x # } # end # # Using the multiline modifier will raise an +ArgumentError+. # Encoding regular expression modifiers are silently ignored. The # match will always use the default encoding or ASCII. # # == External redirects # # You can redirect any path to another path using the redirect helper in your router: # # get "/stories", to: redirect("/posts") # # == Unicode character routes # # You can specify unicode character routes in your router: # # get "こんにちは", to: "welcome#index" # # == Routing to Rack Applications # # Instead of a String, like posts#index, which corresponds to the # index action in the PostsController, you can specify any Rack application # as the endpoint for a matcher: # # get "/application.js", to: Sprockets # # == Reloading routes # # You can reload routes if you feel you must: # # Rails.application.reload_routes! # # This will clear all named routes and reload config/routes.rb if the file has been modified from # last load. To absolutely force reloading, use reload!. # # == Testing Routes # # The two main methods for testing your routes: # # === +assert_routing+ # # def test_movie_route_properly_splits # opts = {controller: "plugin", action: "checkout", id: "2"} # assert_routing "plugin/checkout/2", opts # end # # +assert_routing+ lets you test whether or not the route properly resolves into options. # # === +assert_recognizes+ # # def test_route_has_options # opts = {controller: "plugin", action: "show", id: "12"} # assert_recognizes opts, "/plugins/show/12" # end # # Note the subtle difference between the two: +assert_routing+ tests that # a URL fits options while +assert_recognizes+ tests that a URL # breaks into parameters properly. # # In tests you can simply pass the URL or named route to +get+ or +post+. # # def send_to_jail # get '/jail' # assert_response :success # end # # def goes_to_login # get login_url # #... # end # # == View a list of all your routes # # rails routes # # Target a specific controller with -c, or grep routes # using -g. Useful in conjunction with --expanded # which displays routes vertically. # # source://actionpack//lib/action_dispatch/routing.rb#248 module ActionDispatch::Routing extend ::ActiveSupport::Autoload end # source://actionpack//lib/action_dispatch/routing/inspector.rb#129 module ActionDispatch::Routing::ConsoleFormatter; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#130 class ActionDispatch::Routing::ConsoleFormatter::Base # @return [Base] a new instance of Base # # source://actionpack//lib/action_dispatch/routing/inspector.rb#131 def initialize; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#145 def header(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#148 def no_routes(routes, filter); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#135 def result; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#142 def section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#139 def section_title(title); end end # source://actionpack//lib/action_dispatch/routing/inspector.rb#202 class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base # @return [Expanded] a new instance of Expanded # # source://actionpack//lib/action_dispatch/routing/inspector.rb#203 def initialize(width: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#212 def section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#208 def section_title(title); end private # source://actionpack//lib/action_dispatch/routing/inspector.rb#217 def draw_expanded_section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#229 def route_header(index:); end end # source://actionpack//lib/action_dispatch/routing/inspector.rb#166 class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base # source://actionpack//lib/action_dispatch/routing/inspector.rb#175 def header(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#171 def section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#167 def section_title(title); end private # source://actionpack//lib/action_dispatch/routing/inspector.rb#189 def draw_header(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#180 def draw_section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#195 def widths(routes); end end # source://actionpack//lib/action_dispatch/routing/endpoint.rb#5 class ActionDispatch::Routing::Endpoint # source://actionpack//lib/action_dispatch/routing/endpoint.rb#9 def app; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/endpoint.rb#6 def dispatcher?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/endpoint.rb#12 def engine?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/endpoint.rb#8 def matches?(req); end # source://actionpack//lib/action_dispatch/routing/endpoint.rb#10 def rack_app; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/endpoint.rb#7 def redirect?; end end # source://actionpack//lib/action_dispatch/routing.rb#258 ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/inspector.rb#235 class ActionDispatch::Routing::HtmlTableFormatter # @return [HtmlTableFormatter] a new instance of HtmlTableFormatter # # source://actionpack//lib/action_dispatch/routing/inspector.rb#236 def initialize(view); end # The header is part of the HTML page, so we don't construct it here. # # source://actionpack//lib/action_dispatch/routing/inspector.rb#250 def header(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#253 def no_routes(*_arg0); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#266 def result; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#245 def section(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#241 def section_title(title); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#12 class ActionDispatch::Routing::Mapper include ::ActionDispatch::Routing::Mapper::Base include ::ActionDispatch::Routing::Mapper::HttpHelpers include ::ActionDispatch::Routing::Redirection include ::ActionDispatch::Routing::Mapper::Scoping include ::ActionDispatch::Routing::Mapper::Concerns include ::ActionDispatch::Routing::Mapper::Resources include ::ActionDispatch::Routing::Mapper::CustomUrls # @return [Mapper] a new instance of Mapper # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2279 def initialize(set); end class << self # source://actionpack//lib/action_dispatch/routing/mapper.rb#381 def normalize_name(name); end # Invokes Journey::Router::Utils.normalize_path, then ensures that # /(:locale) becomes (/:locale). Except for root cases, where the # former is the correct one. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#364 def normalize_path(path); end end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#385 module ActionDispatch::Routing::Mapper::Base # source://actionpack//lib/action_dispatch/routing/mapper.rb#618 def default_url_options(options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#618 def default_url_options=(options); end # Query if the following named route was already defined. # # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#630 def has_named_route?(name); end # Matches a URL pattern to one or more routes. # # You should not use the +match+ method in your router # without specifying an HTTP method. # # If you want to expose your action to both GET and POST, use: # # # sets :controller, :action, and :id in params # match ':controller/:action/:id', via: [:get, :post] # # Note that +:controller+, +:action+, and +:id+ are interpreted as URL # query parameters and thus available through +params+ in an action. # # If you want to expose your action to GET, use +get+ in the router: # # Instead of: # # match ":controller/:action/:id" # # Do: # # get ":controller/:action/:id" # # Two of these symbols are special, +:controller+ maps to the controller # and +:action+ to the controller's action. A pattern can also map # wildcard segments (globs) to params: # # get 'songs/*category/:title', to: 'songs#show' # # # 'songs/rock/classic/stairway-to-heaven' sets # # params[:category] = 'rock/classic' # # params[:title] = 'stairway-to-heaven' # # To match a wildcard parameter, it must have a name assigned to it. # Without a variable name to attach the glob parameter to, the route # can't be parsed. # # When a pattern points to an internal route, the route's +:action+ and # +:controller+ should be set in options or hash shorthand. Examples: # # match 'photos/:id' => 'photos#show', via: :get # match 'photos/:id', to: 'photos#show', via: :get # match 'photos/:id', controller: 'photos', action: 'show', via: :get # # A pattern can also point to a +Rack+ endpoint i.e. anything that # responds to +call+: # # match 'photos/:id', to: -> (hash) { [200, {}, ["Coming soon"]] }, via: :get # match 'photos/:id', to: PhotoRackApp, via: :get # # Yes, controller actions are just rack endpoints # match 'photos/:id', to: PhotosController.action(:show), via: :get # # Because requesting various HTTP verbs with a single action has security # implications, you must either specify the actions in # the via options or use one of the HttpHelpers[rdoc-ref:HttpHelpers] # instead +match+ # # === Options # # Any options not seen here are passed on as params with the URL. # # [:controller] # The route's controller. # # [:action] # The route's action. # # [:param] # Overrides the default resource identifier +:id+ (name of the # dynamic segment used to generate the routes). # You can access that segment from your controller using # params[<:param>]. # In your router: # # resources :users, param: :name # # The +users+ resource here will have the following routes generated for it: # # GET /users(.:format) # POST /users(.:format) # GET /users/new(.:format) # GET /users/:name/edit(.:format) # GET /users/:name(.:format) # PATCH/PUT /users/:name(.:format) # DELETE /users/:name(.:format) # # You can override ActiveRecord::Base#to_param of a related # model to construct a URL: # # class User < ActiveRecord::Base # def to_param # name # end # end # # user = User.find_by(name: 'Phusion') # user_path(user) # => "/users/Phusion" # # [:path] # The path prefix for the routes. # # [:module] # The namespace for :controller. # # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get # # => Sekret::PostsController # # See Scoping#namespace for its scope equivalent. # # [:as] # The name used to generate routing helpers. # # [:via] # Allowed HTTP verb(s) for route. # # match 'path', to: 'c#a', via: :get # match 'path', to: 'c#a', via: [:get, :post] # match 'path', to: 'c#a', via: :all # # [:to] # Points to a +Rack+ endpoint. Can be an object that responds to # +call+ or a string representing a controller's action. # # match 'path', to: 'controller#action', via: :get # match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get # match 'path', to: RackApp, via: :get # # [:on] # Shorthand for wrapping routes in a specific RESTful context. Valid # values are +:member+, +:collection+, and +:new+. Only use within # resource(s) block. For example: # # resource :bar do # match 'foo', to: 'c#a', on: :member, via: [:get, :post] # end # # Is equivalent to: # # resource :bar do # member do # match 'foo', to: 'c#a', via: [:get, :post] # end # end # # [:constraints] # Constrains parameters with a hash of regular expressions # or an object that responds to matches?. In addition, constraints # other than path can also be specified with any object # that responds to === (e.g. String, Array, Range, etc.). # # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get # # match 'json_only', constraints: { format: 'json' }, via: :get # # class PermitList # def matches?(request) request.remote_ip == '1.2.3.4' end # end # match 'path', to: 'c#a', constraints: PermitList.new, via: :get # # See Scoping#constraints for more examples with its scope # equivalent. # # [:defaults] # Sets defaults for parameters # # # Sets params[:format] to 'jpg' by default # match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get # # See Scoping#defaults for its scope equivalent. # # [:anchor] # Boolean to anchor a match pattern. Default is true. When set to # false, the pattern matches any request prefixed with the given path. # # # Matches any request starting with 'path' # match 'path', to: 'c#a', anchor: false, via: :get # # [:format] # Allows you to specify the default value for optional +format+ # segment or disable it by supplying +false+. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#566 def match(path, options = T.unsafe(nil)); end # Mount a Rack-based application to be used within the application. # # mount SomeRackApp, at: "some_route" # # Alternatively: # # mount(SomeRackApp => "some_route") # # For options, see +match+, as +mount+ uses it internally. # # All mounted applications come with routing helpers to access them. # These are named after the class specified, so for the above example # the helper is either +some_rack_app_path+ or +some_rack_app_url+. # To customize this helper's name, use the +:as+ option: # # mount(SomeRackApp => "some_route", as: "exciting") # # This will generate the +exciting_path+ and +exciting_url+ helpers # which can be used to navigate to this mounted app. # # @raise [ArgumentError] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#588 def mount(app, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#623 def with_default_scope(scope, &block); end private # source://actionpack//lib/action_dispatch/routing/mapper.rb#639 def app_name(app, rails_app); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#648 def define_generate_prefix(app, name); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#635 def rails_app?(app); end end # Routing Concerns allow you to declare common routes that can be reused # inside others resources and routes. # # concern :commentable do # resources :comments # end # # concern :image_attachable do # resources :images, only: :index # end # # These concerns are used in Resources routing: # # resources :messages, concerns: [:commentable, :image_attachable] # # or in a scope or namespace: # # namespace :posts do # concerns :commentable # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1991 module ActionDispatch::Routing::Mapper::Concerns # Define a routing concern using a name. # # Concerns may be defined inline, using a block, or handled by # another object, by passing that object as the second parameter. # # The concern object, if supplied, should respond to call, # which will receive two parameters: # # * The current mapper # * A hash of options which the concern object may use # # Options may also be used by concerns defined in a block by accepting # a block parameter. So, using a block, you might do something as # simple as limit the actions available on certain resources, passing # standard resource options through the concern: # # concern :commentable do |options| # resources :comments, options # end # # resources :posts, concerns: :commentable # resources :archived_posts do # # Don't allow comments on archived posts # concerns :commentable, only: [:index, :show] # end # # Or, using a callable object, you might implement something more # specific to your application, which would be out of place in your # routes file. # # # purchasable.rb # class Purchasable # def initialize(defaults = {}) # @defaults = defaults # end # # def call(mapper, options = {}) # options = @defaults.merge(options) # mapper.resources :purchases # mapper.resources :receipts # mapper.resources :returns if options[:returnable] # end # end # # # routes.rb # concern :purchasable, Purchasable.new(returnable: true) # # resources :toys, concerns: :purchasable # resources :electronics, concerns: :purchasable # resources :pets do # concerns :purchasable, returnable: false # end # # Any routing helpers can be used inside a concern. If using a # callable, they're accessible from the Mapper that's passed to # call. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2048 def concern(name, callable = T.unsafe(nil), &block); end # Use the named concerns # # resources :posts do # concerns :commentable # end # # Concerns also work in any routes helper that you want to use: # # namespace :posts do # concerns :commentable # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2064 def concerns(*args); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#15 class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint # @return [Constraints] a new instance of Constraints # # source://actionpack//lib/action_dispatch/routing/mapper.rb#21 def initialize(app, constraints, strategy); end # Returns the value of attribute app. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 def app; end # Returns the value of attribute constraints. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 def constraints; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#36 def dispatcher?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#38 def matches?(req); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#45 def serve(req); end private # source://actionpack//lib/action_dispatch/routing/mapper.rb#52 def constraint_args(constraint, request); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#19 ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/routing/mapper.rb#18 ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/routing/mapper.rb#2076 module ActionDispatch::Routing::Mapper::CustomUrls # Define custom URL helpers that will be added to the application's # routes. This allows you to override and/or replace the default behavior # of routing helpers, e.g: # # direct :homepage do # "https://rubyonrails.org" # end # # direct :commentable do |model| # [ model, anchor: model.dom_id ] # end # # direct :main do # { controller: "pages", action: "index", subdomain: "www" } # end # # The return value from the block passed to +direct+ must be a valid set of # arguments for +url_for+ which will actually build the URL string. This can # be one of the following: # # * A string, which is treated as a generated URL # * A hash, e.g. { controller: "pages", action: "index" } # * An array, which is passed to +polymorphic_url+ # * An Active Model instance # * An Active Model class # # NOTE: Other URL helpers can be called in the block but be careful not to invoke # your custom URL helper again otherwise it will result in a stack overflow error. # # You can also specify default options that will be passed through to # your URL helper definition, e.g: # # direct :browse, page: 1, size: 10 do |options| # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] # end # # In this instance the +params+ object comes from the context in which the # block is executed, e.g. generating a URL inside a controller action or a view. # If the block is executed where there isn't a +params+ object such as this: # # Rails.application.routes.url_helpers.browse_path # # then it will raise a +NameError+. Because of this you need to be aware of the # context in which you will use your custom URL helper when defining it. # # NOTE: The +direct+ method can't be used inside of a scope block such as # +namespace+ or +scope+ and will raise an error if it detects that it is. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2124 def direct(name, options = T.unsafe(nil), &block); end # Define custom polymorphic mappings of models to URLs. This alters the # behavior of +polymorphic_url+ and consequently the behavior of # +link_to+ and +form_for+ when passed a model instance, e.g: # # resource :basket # # resolve "Basket" do # [:basket] # end # # This will now generate "/basket" when a +Basket+ instance is passed to # +link_to+ or +form_for+ instead of the standard "/baskets/:id". # # NOTE: This custom behavior only applies to simple polymorphic URLs where # a single model instance is passed and not more complicated forms, e.g: # # # config/routes.rb # resource :profile # namespace :admin do # resources :users # end # # resolve("User") { [:profile] } # # # app/views/application/_menu.html.erb # link_to "Profile", @current_user # link_to "Profile", [:admin, @current_user] # # The first +link_to+ will generate "/profile" but the second will generate # the standard polymorphic URL of "/admin/users/1". # # You can pass options to a polymorphic mapping - the arity for the block # needs to be two as the instance is passed as the first argument, e.g: # # resolve "Basket", anchor: "items" do |basket, options| # [:basket, options] # end # # This generates the URL "/basket#items" because when the last item in an # array passed to +polymorphic_url+ is a hash then it's treated as options # to the URL helper that gets called. # # NOTE: The +resolve+ method can't be used inside of a scope block such as # +namespace+ or +scope+ and will raise an error if it detects that it is. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2176 def resolve(*args, &block); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#682 module ActionDispatch::Routing::Mapper::HttpHelpers # Define a route that only recognizes HTTP DELETE. # For supported arguments, see match[rdoc-ref:Base#match] # # delete 'broccoli', to: 'food#broccoli' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#719 def delete(*args, &block); end # Define a route that only recognizes HTTP GET. # For supported arguments, see match[rdoc-ref:Base#match] # # get 'bacon', to: 'food#bacon' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#687 def get(*args, &block); end # Define a route that only recognizes HTTP OPTIONS. # For supported arguments, see match[rdoc-ref:Base#match] # # options 'carrots', to: 'food#carrots' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#727 def options(*args, &block); end # Define a route that only recognizes HTTP PATCH. # For supported arguments, see match[rdoc-ref:Base#match] # # patch 'bacon', to: 'food#bacon' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#703 def patch(*args, &block); end # Define a route that only recognizes HTTP POST. # For supported arguments, see match[rdoc-ref:Base#match] # # post 'bacon', to: 'food#bacon' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#695 def post(*args, &block); end # Define a route that only recognizes HTTP PUT. # For supported arguments, see match[rdoc-ref:Base#match] # # put 'bacon', to: 'food#bacon' # # source://actionpack//lib/action_dispatch/routing/mapper.rb#711 def put(*args, &block); end private # source://actionpack//lib/action_dispatch/routing/mapper.rb#732 def map_method(method, args, &block); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#69 class ActionDispatch::Routing::Mapper::Mapping # @return [Mapping] a new instance of Mapping # # source://actionpack//lib/action_dispatch/routing/mapper.rb#118 def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, options:); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#176 def application; end # Returns the value of attribute ast. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def ast; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#180 def conditions; end # Returns the value of attribute default_action. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def default_action; end # Returns the value of attribute default_controller. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def default_controller; end # Returns the value of attribute defaults. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def defaults; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#169 def make_route(name, precedence); end # Returns the value of attribute path. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def path; end # Returns the value of attribute required_defaults. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def required_defaults; end # Returns the value of attribute requirements. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def requirements; end # Returns the value of attribute scope_options. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def scope_options; end # Returns the value of attribute to. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 def to; end private # source://actionpack//lib/action_dispatch/routing/mapper.rb#316 def add_controller_module(controller, modyoule); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#269 def app(blocks); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#335 def blocks(callable_constraint); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#184 def build_conditions(current_conditions, request_class); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#281 def check_controller_and_action(path_params, controller, action); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#296 def check_part(name, part, path_params, hash); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#342 def constraints(options, path_params); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#356 def dispatcher(raise_on_name_error); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#199 def intern(object); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#265 def normalize_defaults(options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#233 def normalize_format(formatted); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#203 def normalize_options!(options, path_params, modyoule); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#193 def request_method; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#227 def split_constraints(path_params, constraints); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#308 def split_to(to); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#328 def translate_controller(controller); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#249 def verify_regexp_requirements(requirements, wildcard_options); end class << self # source://actionpack//lib/action_dispatch/routing/mapper.rb#76 def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#90 def check_via(via); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#102 def normalize_path(path, format); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#114 def optional_format?(path, format); end end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#70 ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch/routing/mapper.rb#167 ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/routing/mapper.rb#71 ActionDispatch::Routing::Mapper::Mapping::OPTIONAL_FORMAT_REGEX = T.let(T.unsafe(nil), Regexp) # Resource routing allows you to quickly declare all of the common routes # for a given resourceful controller. Instead of declaring separate routes # for your +index+, +show+, +new+, +edit+, +create+, +update+, and +destroy+ # actions, a resourceful route declares them in a single line of code: # # resources :photos # # Sometimes, you have a resource that clients always look up without # referencing an ID. A common example, /profile always shows the profile of # the currently logged in user. In this case, you can use a singular resource # to map /profile (rather than /profile/:id) to the show action. # # resource :profile # # It's common to have resources that are logically children of other # resources: # # resources :magazines do # resources :ads # end # # You may wish to organize groups of controllers under a namespace. Most # commonly, you might group a number of administrative controllers under # an +admin+ namespace. You would place these controllers under the # app/controllers/admin directory, and you can group them together # in your router: # # namespace "admin" do # resources :posts, :comments # end # # By default the +:id+ parameter doesn't accept dots. If you need to # use dots as part of the +:id+ parameter add a constraint which # overrides this restriction, e.g: # # resources :articles, id: /[^\/]+/ # # This allows any character other than a slash as part of your +:id+. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1122 module ActionDispatch::Routing::Mapper::Resources # To add a route to the collection: # # resources :photos do # collection do # get 'search' # end # end # # This will enable Rails to recognize paths such as /photos/search # with GET, and route to the search action of +PhotosController+. It will also # create the search_photos_url and search_photos_path # route helpers. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1500 def collection(&block); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1587 def draw(name); end # Matches a URL pattern to one or more routes. # For more information, see match[rdoc-ref:Base#match]. # # match 'path' => 'controller#action', via: :patch # match 'path', to: 'controller#action', via: :post # match 'path', 'otherpath', on: :member, via: :get # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1609 def match(path, *rest, &block); end # To add a member route, add a member block into the resource block: # # resources :photos do # member do # get 'preview' # end # end # # This will recognize /photos/1/preview with GET, and route to the # preview action of +PhotosController+. It will also create the # preview_photo_url and preview_photo_path helpers. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1521 def member(&block); end # See ActionDispatch::Routing::Mapper::Scoping#namespace. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1568 def namespace(path, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1547 def nested(&block); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1537 def new(&block); end # Sometimes, you have a resource that clients always look up without # referencing an ID. A common example, /profile always shows the # profile of the currently logged in user. In this case, you can use # a singular resource to map /profile (rather than /profile/:id) to # the show action: # # resource :profile # # This creates six different routes in your application, all mapping to # the +Profiles+ controller (note that the controller is named after # the plural): # # GET /profile/new # GET /profile # GET /profile/edit # PATCH/PUT /profile # DELETE /profile # POST /profile # # If you want instances of a model to work with this resource via # record identification (e.g. in +form_with+ or +redirect_to+), you # will need to call resolve[rdoc-ref:CustomUrls#resolve]: # # resource :profile # resolve('Profile') { [:profile] } # # # Enables this to work with singular routes: # form_with(model: @profile) {} # # === Options # Takes same options as resources[rdoc-ref:#resources] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1292 def resource(*resources, &block); end # In Rails, a resourceful route provides a mapping between HTTP verbs # and URLs and controller actions. By convention, each action also maps # to particular CRUD operations in a database. A single entry in the # routing file, such as # # resources :photos # # creates seven different routes in your application, all mapping to # the +Photos+ controller: # # GET /photos # GET /photos/new # POST /photos # GET /photos/:id # GET /photos/:id/edit # PATCH/PUT /photos/:id # DELETE /photos/:id # # Resources can also be nested infinitely by using this block syntax: # # resources :photos do # resources :comments # end # # This generates the following comments routes: # # GET /photos/:photo_id/comments # GET /photos/:photo_id/comments/new # POST /photos/:photo_id/comments # GET /photos/:photo_id/comments/:id # GET /photos/:photo_id/comments/:id/edit # PATCH/PUT /photos/:photo_id/comments/:id # DELETE /photos/:photo_id/comments/:id # # === Options # Takes same options as match[rdoc-ref:Base#match] as well as: # # [:path_names] # Allows you to change the segment component of the +edit+ and +new+ actions. # Actions not specified are not changed. # # resources :posts, path_names: { new: "brand_new" } # # The above example will now change /posts/new to /posts/brand_new. # # [:path] # Allows you to change the path prefix for the resource. # # resources :posts, path: 'postings' # # The resource and all segments will now route to /postings instead of /posts. # # [:only] # Only generate routes for the given actions. # # resources :cows, only: :show # resources :cows, only: [:show, :index] # # [:except] # Generate all routes except for the given actions. # # resources :cows, except: :show # resources :cows, except: [:show, :index] # # [:shallow] # Generates shallow routes for nested resource(s). When placed on a parent resource, # generates shallow routes for all nested resources. # # resources :posts, shallow: true do # resources :comments # end # # Is the same as: # # resources :posts do # resources :comments, except: [:show, :edit, :update, :destroy] # end # resources :comments, only: [:show, :edit, :update, :destroy] # # This allows URLs for resources that otherwise would be deeply nested such # as a comment on a blog post like /posts/a-long-permalink/comments/1234 # to be shortened to just /comments/1234. # # Set shallow: false on a child resource to ignore a parent's shallow parameter. # # [:shallow_path] # Prefixes nested shallow routes with the specified path. # # scope shallow_path: "sekret" do # resources :posts do # resources :comments, shallow: true # end # end # # The +comments+ resource here will have the following routes generated for it: # # post_comments GET /posts/:post_id/comments(.:format) # post_comments POST /posts/:post_id/comments(.:format) # new_post_comment GET /posts/:post_id/comments/new(.:format) # edit_comment GET /sekret/comments/:id/edit(.:format) # comment GET /sekret/comments/:id(.:format) # comment PATCH/PUT /sekret/comments/:id(.:format) # comment DELETE /sekret/comments/:id(.:format) # # [:shallow_prefix] # Prefixes nested shallow route names with specified prefix. # # scope shallow_prefix: "sekret" do # resources :posts do # resources :comments, shallow: true # end # end # # The +comments+ resource here will have the following routes generated for it: # # post_comments GET /posts/:post_id/comments(.:format) # post_comments POST /posts/:post_id/comments(.:format) # new_post_comment GET /posts/:post_id/comments/new(.:format) # edit_sekret_comment GET /comments/:id/edit(.:format) # sekret_comment GET /comments/:id(.:format) # sekret_comment PATCH/PUT /comments/:id(.:format) # sekret_comment DELETE /comments/:id(.:format) # # [:format] # Allows you to specify the default value for optional +format+ # segment or disable it by supplying +false+. # # [:param] # Allows you to override the default param name of +:id+ in the URL. # # === Examples # # # routes call Admin::PostsController # resources :posts, module: "admin" # # # resource actions are at /admin/posts. # resources :posts, path: "admin/posts" # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1458 def resources(*resources, &block); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1257 def resources_path_names(options); end # You can specify what Rails should route "/" to with the root method: # # root to: 'pages#main' # # For options, see +match+, as +root+ uses it internally. # # You can also pass a string which will expand # # root 'pages#main' # # You should put the root route at the top of config/routes.rb, # because this means it will be matched first. As this is the most popular route # of most Rails applications, this is beneficial. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1656 def root(path, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1576 def shallow; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1583 def shallow?; end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1720 def action_options?(options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1802 def action_path(name); end # @raise [ArgumentError] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1938 def add_route(action, controller, options, _path, to, via, formatted, anchor, options_constraints); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1856 def api_only?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1715 def apply_action_options(options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1681 def apply_common_behavior_for(method, resources, options, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1778 def canonical_action?(action); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1923 def decomposed_match(path, controller, options, _path, to, via, formatted, anchor, options_constraints); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1908 def get_to_from_path(path, to, action); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1867 def map_match(paths, options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1965 def match_root_route(options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1818 def name_for_action(as, action); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1755 def nested_options; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1736 def nested_scope?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1774 def param_constraint; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1770 def param_constraint?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1677 def parent_resource; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1792 def path_for_action(action, path); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1860 def path_scope(path); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1806 def prefix_name_for_action(as, action); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1732 def resource_method_scope?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1747 def resource_scope(resource, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1728 def resource_scope?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1724 def scope_action_options; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1844 def set_member_mappings_for_resource; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1764 def shallow_nesting_depth; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1782 def shallow_scope; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1919 def using_match_shorthand?(path); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1740 def with_scope_level(kind); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1127 ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/mapper.rb#1126 ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/mapper.rb#1129 class ActionDispatch::Routing::Mapper::Resources::Resource # @return [Resource] a new instance of Resource # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1132 def initialize(entities, api_only, shallow, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1157 def actions; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1165 def available_actions; end # Checks for uncountable plurals, and appends "_index" if the plural # and singular form are the same. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1189 def collection_name; end # Returns the value of attribute path. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def collection_scope; end # Returns the value of attribute controller. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def controller; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1149 def default_actions; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1181 def member_name; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 def member_scope; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1173 def name; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1209 def nested_param; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1213 def nested_scope; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1205 def new_scope(new_path); end # Returns the value of attribute param. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def param; end # Returns the value of attribute path. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def path; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1177 def plural; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1193 def resource_scope; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1217 def shallow?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 def shallow_scope; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1221 def singleton?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1181 def singular; end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1224 class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource # @return [SingletonResource] a new instance of SingletonResource # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1225 def initialize(entities, api_only, shallow, options); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 def collection_name; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1232 def default_actions; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 def member_name; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def member_scope; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 def nested_scope; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1240 def plural; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1254 def singleton?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 def singular; end end # CANONICAL_ACTIONS holds all actions that does not need a prefix or # a path appended since they fit properly in their scope level. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1125 ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/mapper.rb#2190 class ActionDispatch::Routing::Mapper::Scope include ::Enumerable # @return [Scope] a new instance of Scope # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2200 def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2259 def [](key); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2226 def action_name(name_prefix, prefix, collection_name, member_name); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2266 def each; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2274 def frame; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2206 def nested?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2251 def new(hash); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2255 def new_level(level); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2210 def null?; end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2247 def options; end # Returns the value of attribute parent. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2198 def parent; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2222 def resource_method_scope?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2243 def resource_scope?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2218 def resources?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2214 def root?; end # Returns the value of attribute scope_level. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#2198 def scope_level; end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#2276 ActionDispatch::Routing::Mapper::Scope::NULL = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) # source://actionpack//lib/action_dispatch/routing/mapper.rb#2191 ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/mapper.rb#2196 ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/mapper.rb#2195 ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) # You may wish to organize groups of controllers under a namespace. # Most commonly, you might group a number of administrative controllers # under an +admin+ namespace. You would place these controllers under # the app/controllers/admin directory, and you can group them # together in your router: # # namespace "admin" do # resources :posts, :comments # end # # This will create a number of routes for each of the posts and comments # controller. For Admin::PostsController, Rails will create: # # GET /admin/posts # GET /admin/posts/new # POST /admin/posts # GET /admin/posts/1 # GET /admin/posts/1/edit # PATCH/PUT /admin/posts/1 # DELETE /admin/posts/1 # # If you want to route /posts (without the prefix /admin) to # Admin::PostsController, you could use # # scope module: "admin" do # resources :posts # end # # or, for a single case # # resources :posts, module: "admin" # # If you want to route /admin/posts to +PostsController+ # (without the Admin:: module prefix), you could use # # scope "/admin" do # resources :posts # end # # or, for a single case # # resources :posts, path: "/admin/posts" # # In each of these cases, the named routes remain the same as if you did # not use scope. In the last case, the following paths map to # +PostsController+: # # GET /admin/posts # GET /admin/posts/new # POST /admin/posts # GET /admin/posts/1 # GET /admin/posts/1/edit # PATCH/PUT /admin/posts/1 # DELETE /admin/posts/1 # # source://actionpack//lib/action_dispatch/routing/mapper.rb#794 module ActionDispatch::Routing::Mapper::Scoping # === Parameter Restriction # Allows you to constrain the nested routes based on a set of rules. # For instance, in order to change the routes to allow for a dot character in the +id+ parameter: # # constraints(id: /\d+\.\d+/) do # resources :posts # end # # Now routes such as +/posts/1+ will no longer be valid, but +/posts/1.1+ will be. # The +id+ parameter must match the constraint passed in for this example. # # You may use this to also restrict other parameters: # # resources :posts do # constraints(post_id: /\d+\.\d+/) do # resources :comments # end # end # # === Restricting based on IP # # Routes can also be constrained to an IP or a certain range of IP addresses: # # constraints(ip: /192\.168\.\d+\.\d+/) do # resources :posts # end # # Any user connecting from the 192.168.* range will be able to see this resource, # where as any user connecting outside of this range will be told there is no such route. # # === Dynamic request matching # # Requests to routes can be constrained based on specific criteria: # # constraints(-> (req) { /iPhone/.match?(req.env["HTTP_USER_AGENT"]) }) do # resources :iphones # end # # You are able to move this logic out into a class if it is too complex for routes. # This class must have a +matches?+ method defined on it which either returns +true+ # if the user should be given access to that route, or +false+ if the user should not. # # class Iphone # def self.matches?(request) # /iPhone/.match?(request.env["HTTP_USER_AGENT"]) # end # end # # An expected place for this code would be +lib/constraints+. # # This class is then used like this: # # constraints(Iphone) do # resources :iphones # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#999 def constraints(constraints = T.unsafe(nil), &block); end # Scopes routes to a specific controller # # controller "food" do # match "bacon", action: :bacon, via: :get # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#884 def controller(controller); end # Allows you to set default parameters for a route, such as this: # defaults id: 'home' do # match 'scoped_pages/(:id)', to: 'pages#show' # end # Using this, the +:id+ parameter here will default to 'home'. # # source://actionpack//lib/action_dispatch/routing/mapper.rb#1008 def defaults(defaults = T.unsafe(nil)); end # Scopes routes to a specific namespace. For example: # # namespace :admin do # resources :posts # end # # This generates the following routes: # # admin_posts GET /admin/posts(.:format) admin/posts#index # admin_posts POST /admin/posts(.:format) admin/posts#create # new_admin_post GET /admin/posts/new(.:format) admin/posts#new # edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit # admin_post GET /admin/posts/:id(.:format) admin/posts#show # admin_post PATCH/PUT /admin/posts/:id(.:format) admin/posts#update # admin_post DELETE /admin/posts/:id(.:format) admin/posts#destroy # # === Options # # The +:path+, +:as+, +:module+, +:shallow_path+, and +:shallow_prefix+ # options all default to the name of the namespace. # # For options, see Base#match. For +:shallow_path+ option, see # Resources#resources. # # # accessible through /sekret/posts rather than /admin/posts # namespace :admin, path: "sekret" do # resources :posts # end # # # maps to Sekret::PostsController rather than Admin::PostsController # namespace :admin, module: "sekret" do # resources :posts # end # # # generates +sekret_posts_path+ rather than +admin_posts_path+ # namespace :admin, as: "sekret" do # resources :posts # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#929 def namespace(path, options = T.unsafe(nil), &block); end # Scopes a set of routes to the given default options. # # Take the following route definition as an example: # # scope path: ":account_id", as: "account" do # resources :projects # end # # This generates helpers such as +account_projects_path+, just like +resources+ does. # The difference here being that the routes generated are like /:account_id/projects, # rather than /accounts/:account_id/projects. # # === Options # # Takes same options as Base#match and Resources#resources. # # # route /posts (without the prefix /admin) to Admin::PostsController # scope module: "admin" do # resources :posts # end # # # prefix the posts resource's requests with '/admin' # scope path: "/admin" do # resources :posts # end # # # prefix the routing helper name: +sekret_posts_path+ instead of +posts_path+ # scope as: "sekret" do # resources :posts # end # # source://actionpack//lib/action_dispatch/routing/mapper.rb#825 def scope(*args); end private # source://actionpack//lib/action_dispatch/routing/mapper.rb#1040 def merge_action_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1024 def merge_as_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1064 def merge_blocks_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1056 def merge_constraints_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1036 def merge_controller_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1060 def merge_defaults_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1048 def merge_format_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1032 def merge_module_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1070 def merge_options_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1052 def merge_path_names_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1016 def merge_path_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1020 def merge_shallow_path_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1028 def merge_shallow_prefix_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1074 def merge_shallow_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1078 def merge_to_scope(parent, child); end # source://actionpack//lib/action_dispatch/routing/mapper.rb#1044 def merge_via_scope(parent, child); end end # source://actionpack//lib/action_dispatch/routing/mapper.rb#877 ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) # source://actionpack//lib/action_dispatch/routing/mapper.rb#13 ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/redirection.rb#103 class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect # source://actionpack//lib/action_dispatch/routing/redirection.rb#132 def inspect; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 def options; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#106 def path(params, request); end end # source://actionpack//lib/action_dispatch/routing/redirection.rb#78 class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect # source://actionpack//lib/action_dispatch/routing/redirection.rb#93 def inspect; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#81 def path(params, request); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/redirection.rb#98 def interpolation_required?(string, params); end end # source://actionpack//lib/action_dispatch/routing/redirection.rb#79 ActionDispatch::Routing::PathRedirect::URL_PARTS = T.let(T.unsafe(nil), Regexp) # Polymorphic URL helpers are methods for smart resolution to a named route call when # given an Active Record model instance. They are to be used in combination with # ActionController::Resources. # # These methods are useful when you want to generate the correct URL or path to a RESTful # resource without having to know the exact type of the record in question. # # Nested resources and/or namespaces are also supported, as illustrated in the example: # # polymorphic_url([:admin, @article, @comment]) # # results in: # # admin_article_comment_url(@article, @comment) # # == Usage within the framework # # Polymorphic URL helpers are used in a number of places throughout the \Rails framework: # # * url_for, so you can use it with a record as the argument, e.g. # url_for(@article); # * ActionView::Helpers::FormHelper uses polymorphic_path, so you can write # form_for(@article) without having to specify :url parameter for the form # action; # * redirect_to (which, in fact, uses url_for) so you can write # redirect_to(post) in your controllers; # * ActionView::Helpers::AtomFeedHelper, so you don't have to explicitly specify URLs # for feed entries. # # == Prefixed polymorphic helpers # # In addition to polymorphic_url and polymorphic_path methods, a # number of prefixed helpers are available as a shorthand to action: "..." # in options. Those are: # # * edit_polymorphic_url, edit_polymorphic_path # * new_polymorphic_url, new_polymorphic_path # # Example usage: # # edit_polymorphic_path(@post) # => "/posts/1/edit" # polymorphic_path(@post, format: :pdf) # => "/posts/1.pdf" # # == Usage with mounted engines # # If you are using a mounted engine and you need to use a polymorphic_url # pointing at the engine's routes, pass in the engine's route proxy as the first # argument to the method. For example: # # polymorphic_url([blog, @post]) # calls blog.post_path(@post) # form_for([blog, @post]) # => "/blog/posts/1" # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#57 module ActionDispatch::Routing::PolymorphicRoutes # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#153 def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#149 def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#153 def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#149 def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end # Returns the path component of a URL for the given record. # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#124 def polymorphic_path(record_or_hash_or_array, options = T.unsafe(nil)); end # Constructs a call to a named RESTful route for the given record and returns the # resulting URL string. For example: # # # calls post_url(post) # polymorphic_url(post) # => "http://example.com/posts/1" # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" # polymorphic_url(Comment) # => "http://example.com/comments" # # ==== Options # # * :action - Specifies the action prefix for the named route: # :new or :edit. Default is no prefix. # * :routing_type - Allowed values are :path or :url. # Default is :url. # # Also includes all the options from url_for. These include such # things as :anchor or :trailing_slash. Example usage # is given below: # # polymorphic_url([blog, post], anchor: 'my_anchor') # # => "http://example.com/blogs/1/posts/1#my_anchor" # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" # # For all of these options, see the documentation for {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor]. # # ==== Functionality # # # an Article record # polymorphic_url(record) # same as article_url(record) # # # a Comment record # polymorphic_url(record) # same as comment_url(record) # # # it recognizes new records and maps to the collection # record = Comment.new # polymorphic_url(record) # same as comments_url() # # # the class of a record will also map to the collection # polymorphic_url(Comment) # same as comments_url() # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#101 def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#168 def polymorphic_mapping(record); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#164 def polymorphic_path_for_action(action, record_or_hash, options); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#160 def polymorphic_url_for_action(action, record_or_hash, options); end end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#176 class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder # @return [HelperMethodBuilder] a new instance of HelperMethodBuilder # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#239 def initialize(key_strategy, prefix, suffix); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#253 def handle_class(klass); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#257 def handle_class_call(target, klass); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#284 def handle_list(list); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#261 def handle_model(record); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#275 def handle_model_call(target, record); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#245 def handle_string(record); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#249 def handle_string_call(target, str); end # Returns the value of attribute prefix. # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#237 def prefix; end # Returns the value of attribute suffix. # # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#237 def suffix; end private # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#338 def get_method_for_class(klass); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#343 def get_method_for_string(str); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#330 def polymorphic_mapping(target, record); end class << self # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#187 def build(action, type); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#179 def get(action, type); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#185 def path; end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#201 def plural(prefix, suffix); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#205 def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#197 def singular(prefix, suffix); end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#184 def url; end end end # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#177 ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/routing/redirection.rb#10 class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint # @return [Redirect] a new instance of Redirect # # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 def initialize(status, block); end # Returns the value of attribute block. # # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 def block; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#20 def call(env); end # source://actionpack//lib/action_dispatch/routing/redirection.rb#56 def inspect; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#52 def path(params, request); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/redirection.rb#18 def redirect?; end # source://actionpack//lib/action_dispatch/routing/redirection.rb#24 def serve(req); end # Returns the value of attribute status. # # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 def status; end private # source://actionpack//lib/action_dispatch/routing/redirection.rb#65 def escape(params); end # source://actionpack//lib/action_dispatch/routing/redirection.rb#69 def escape_fragment(params); end # source://actionpack//lib/action_dispatch/routing/redirection.rb#73 def escape_path(params); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/redirection.rb#61 def relative_path?(path); end end # source://actionpack//lib/action_dispatch/routing/redirection.rb#137 module ActionDispatch::Routing::Redirection # Redirect any path to another path: # # get "/stories" => redirect("/posts") # # This will redirect the user, while ignoring certain parts of the request, including query string, etc. # /stories, /stories?foo=bar, etc all redirect to /posts. # # The redirect will use a 301 Moved Permanently status code by # default. This can be overridden with the +:status+ option: # # get "/stories" => redirect("/posts", status: 307) # # You can also use interpolation in the supplied redirect argument: # # get 'docs/:article', to: redirect('/wiki/%{article}') # # Note that if you return a path without a leading slash then the URL is prefixed with the # current SCRIPT_NAME environment variable. This is typically '/' but may be different in # a mounted engine or where the application is deployed to a subdirectory of a website. # # Alternatively you can use one of the other syntaxes: # # The block version of redirect allows for the easy encapsulation of any logic associated with # the redirect in question. Either the params and request are supplied as arguments, or just # params, depending of how many arguments your block accepts. A string is required as a # return value. # # get 'jokes/:number', to: redirect { |params, request| # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp") # "http://#{request.host_with_port}/#{path}" # } # # Note that the do end syntax for the redirect block wouldn't work, as Ruby would pass # the block to +get+ instead of +redirect+. Use { ... } instead. # # The options version of redirect allows you to supply only the parts of the URL which need # to change, it also supports interpolation of the path similar to the first example. # # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}') # get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}') # get '/stories', to: redirect(path: '/posts') # # This will redirect the user, while changing only the specified parts of the request, # for example the +path+ option in the last example. # /stories, /stories?foo=bar, redirect to /posts and /posts?foo=bar respectively. # # Finally, an object which responds to call can be supplied to redirect, allowing you to reuse # common redirect routes. The call method must accept two arguments, params and request, and return # a string. # # get 'accounts/:name' => redirect(SubdomainRedirector.new('api')) # # @raise [ArgumentError] # # source://actionpack//lib/action_dispatch/routing/redirection.rb#190 def redirect(*args, &block); end end # :stopdoc: # # source://actionpack//lib/action_dispatch/routing/route_set.rb#14 class ActionDispatch::Routing::RouteSet # @return [RouteSet] a new instance of RouteSet # # source://actionpack//lib/action_dispatch/routing/route_set.rb#366 def initialize(config = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#615 def add_polymorphic_mapping(klass, options, &block); end # @raise [ArgumentError] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#584 def add_route(mapping, name); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#619 def add_url_helper(name, options, &block); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#395 def api_only?; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#415 def append(&block); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#849 def call(env); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#439 def clear!; end # Returns the value of attribute default_scope. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def default_scope; end # Sets the attribute default_scope # # @param value the value to set the attribute default_scope to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def default_scope=(_arg0); end # Returns the value of attribute default_url_options. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 def default_url_options; end # Sets the attribute default_url_options # # @param value the value to set the attribute default_url_options to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#461 def define_mounted_helper(name, script_namer = T.unsafe(nil)); end # Returns the value of attribute disable_clear_and_finalize. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 def disable_clear_and_finalize; end # Sets the attribute disable_clear_and_finalize # # @param value the value to set the attribute disable_clear_and_finalize to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 def disable_clear_and_finalize=(_arg0); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#408 def draw(&block); end # Returns the value of attribute draw_paths. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 def draw_paths; end # Sets the attribute draw_paths # # @param value the value to set the attribute draw_paths to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 def draw_paths=(_arg0); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#385 def eager_load!; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#580 def empty?; end # Returns the value of attribute env_key. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#339 def env_key; end # Generate the path indicated by the arguments, and return an array of # the keys that were not used to generate it. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#760 def extra_keys(options, recall = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#433 def finalize!; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#792 def find_relative_url_root(options); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#788 def find_script_name(options); end # Returns the value of attribute formatter. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def formatter; end # Sets the attribute formatter # # @param value the value to set the attribute formatter to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def formatter=(_arg0); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#764 def generate_extras(options, recall = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#488 def generate_url_helpers(supports_path); end # Since the router holds references to many parts of the system # like engines, controllers and the application itself, inspecting # the route set can actually be really slow, therefore we default # alias inspect to to_s. def inspect; end # Contains all the mounted helpers across different # engines and the `main_app` helper for the application. # You can include this in your classes if you want to # access routes for other engines. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#457 def mounted_helpers; end # Returns the value of attribute named_routes. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def named_routes; end # Sets the attribute named_routes # # @param value the value to set the attribute named_routes to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def named_routes=(_arg0); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#784 def optimize_routes_generation?; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#796 def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end # Returns the value of attribute polymorphic_mappings. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#339 def polymorphic_mappings; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#419 def prepend(&block); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#855 def recognize_path(path, environment = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#870 def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#391 def relative_url_root; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#399 def request_class; end # Returns the value of attribute resources_path_names. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 def resources_path_names; end # Sets the attribute resources_path_names # # @param value the value to set the attribute resources_path_names to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 def resources_path_names=(_arg0); end # Returns the value of attribute router. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def router; end # Sets the attribute router # # @param value the value to set the attribute router to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def router=(_arg0); end # Returns the value of attribute set. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def routes; end # Returns the value of attribute set. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def set; end # Sets the attribute set # # @param value the value to set the attribute set to. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 def set=(_arg0); end # The +options+ argument must be a hash whose keys are *symbols*. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#801 def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#480 def url_helpers(supports_path = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/routing/route_set.rb#423 def eval_block(block); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#775 def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#403 def make_request(env); end class << self # source://actionpack//lib/action_dispatch/routing/route_set.rb#343 def default_resources_path_names; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#347 def new_with_config(config); end end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#362 class ActionDispatch::Routing::RouteSet::Config < ::Struct # Returns the value of attribute api_only # # @return [Object] the current value of api_only def api_only; end # Sets the attribute api_only # # @param value [Object] the value to set the attribute api_only to. # @return [Object] the newly set value def api_only=(_); end # Returns the value of attribute relative_url_root # # @return [Object] the current value of relative_url_root def relative_url_root; end # Sets the attribute relative_url_root # # @param value [Object] the value to set the attribute relative_url_root to. # @return [Object] the newly set value def relative_url_root=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#623 class ActionDispatch::Routing::RouteSet::CustomUrlHelper # @return [CustomUrlHelper] a new instance of CustomUrlHelper # # source://actionpack//lib/action_dispatch/routing/route_set.rb#626 def initialize(name, defaults, &block); end # Returns the value of attribute block. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 def block; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#632 def call(t, args, only_path = T.unsafe(nil)); end # Returns the value of attribute defaults. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 def defaults; end # Returns the value of attribute name. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 def name; end private # source://actionpack//lib/action_dispatch/routing/route_set.rb#644 def eval_block(t, args, options); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#648 def merge_defaults(options); end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#364 ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) # source://actionpack//lib/action_dispatch/routing/route_set.rb#21 class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint # @return [Dispatcher] a new instance of Dispatcher # # source://actionpack//lib/action_dispatch/routing/route_set.rb#22 def initialize(raise_on_name_error); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#26 def dispatcher?; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#28 def serve(req); end private # source://actionpack//lib/action_dispatch/routing/route_set.rb#42 def controller(req); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#48 def dispatch(controller, action, req, res); end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#653 class ActionDispatch::Routing::RouteSet::Generator # @return [Generator] a new instance of Generator # # source://actionpack//lib/action_dispatch/routing/route_set.rb#656 def initialize(named_route, options, recall, set); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#668 def controller; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#672 def current_controller; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#743 def different_controller?; end # Generates a path from routes, returns a RouteWithParams or MissingRoute. # MissingRoute will raise ActionController::UrlGenerationError. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#739 def generate; end # Returns the value of attribute named_route. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 def named_route; end # Remove leading slashes from controllers # # source://actionpack//lib/action_dispatch/routing/route_set.rb#727 def normalize_controller!; end # This pulls :controller, :action, and :id out of the recall. # The recall key is only used if there is no key in the options # or if the key in the options is identical. If any of # :controller, :action or :id is not found, don't pull any # more keys from the recall. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#709 def normalize_controller_action_id!; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#684 def normalize_options!; end # Returns the value of attribute options. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 def options; end # Returns the value of attribute recall. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 def recall; end # Returns the value of attribute set. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 def set; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#676 def use_recall_for(key); end # if the current controller is "foo/bar/baz" and controller: "baz/bat" # is specified, the controller becomes "foo/baz/bat" # # source://actionpack//lib/action_dispatch/routing/route_set.rb#717 def use_relative_controller!; end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#749 def named_route_exists?; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#753 def segment_keys; end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#448 module ActionDispatch::Routing::RouteSet::MountedHelpers extend ::ActiveSupport::Concern include GeneratedInstanceMethods include ::ActionDispatch::Routing::UrlFor mixes_in_class_methods GeneratedClassMethods module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # A NamedRouteCollection instance is a collection of named routes, and also # maintains an anonymous module that can be used to install helpers for the # named routes. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#66 class ActionDispatch::Routing::RouteSet::NamedRouteCollection include ::Enumerable # @return [NamedRouteCollection] a new instance of NamedRouteCollection # # source://actionpack//lib/action_dispatch/routing/route_set.rb#71 def initialize; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#121 def [](name); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#102 def []=(name, route); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#102 def add(name, route); end # Given a +name+, defines name_path and name_url helpers. # Used by 'direct', 'resolve', and 'polymorphic' route helpers. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#149 def add_url_helper(name, defaults, &block); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#88 def clear; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#88 def clear!; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#134 def each(&block); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#121 def get(name); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 def helper_names; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#125 def key?(name); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#143 def length; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#139 def names; end # Returns the value of attribute path_helpers_module. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 def path_helpers_module; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#79 def route_defined?(name); end # Returns the value of attribute url_helpers_module. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 def url_helpers_module; end private # Create a URL helper allowing ordered parameters to be associated # with corresponding dynamic segments, so you can do: # # foo_url(bar, baz, bang) # # Instead of: # # foo_url(bar: bar, baz: baz, bang: bang) # # Also allow options hash, so you can do: # # foo_url(bar, baz, bang, sort_by: 'baz') # # source://actionpack//lib/action_dispatch/routing/route_set.rb#317 def define_url_helper(mod, name, helper, url_strategy); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 def routes; end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#172 class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper # @return [UrlHelper] a new instance of UrlHelper # # source://actionpack//lib/action_dispatch/routing/route_set.rb#255 def initialize(route, options, route_name); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#262 def call(t, method_name, args, inner_options, url_strategy); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#274 def handle_positional_args(controller_options, inner_options, args, result, path_params); end # Returns the value of attribute route_name. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#185 def route_name; end class << self # source://actionpack//lib/action_dispatch/routing/route_set.rb#173 def create(route, options, route_name); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#181 def optimize_helper?(route); end end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#187 class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper # @return [OptimizedUrlHelper] a new instance of OptimizedUrlHelper # # source://actionpack//lib/action_dispatch/routing/route_set.rb#190 def initialize(route, options, route_name); end # Returns the value of attribute arg_size. # # source://actionpack//lib/action_dispatch/routing/route_set.rb#188 def arg_size; end # source://actionpack//lib/action_dispatch/routing/route_set.rb#196 def call(t, method_name, args, inner_options, url_strategy); end private # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#227 def optimize_routes_generation?(t); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#219 def optimized_helper(args); end # source://actionpack//lib/action_dispatch/routing/route_set.rb#231 def parameterize_args(args); end # @raise [ActionController::UrlGenerationError] # # source://actionpack//lib/action_dispatch/routing/route_set.rb#242 def raise_generation_error(args); end end # strategy for building URLs to send to the client # # source://actionpack//lib/action_dispatch/routing/route_set.rb#333 ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/routing/route_set.rb#780 ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/routing/route_set.rb#53 class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher # @return [StaticDispatcher] a new instance of StaticDispatcher # # source://actionpack//lib/action_dispatch/routing/route_set.rb#54 def initialize(controller_class); end private # source://actionpack//lib/action_dispatch/routing/route_set.rb#60 def controller(_); end end # source://actionpack//lib/action_dispatch/routing/route_set.rb#334 ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) # source://actionpack//lib/action_dispatch/routing/inspector.rb#8 class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator # source://actionpack//lib/action_dispatch/routing/inspector.rb#41 def action; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#13 def constraints; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#37 def controller; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#9 def endpoint; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/inspector.rb#49 def engine?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/inspector.rb#45 def internal?; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#25 def name; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#21 def path; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#17 def rack_app; end # source://actionpack//lib/action_dispatch/routing/inspector.rb#29 def reqs; end end # This class is just used for displaying route information when someone # executes `bin/rails routes` or looks at the RoutingError page. # People should not use this class. # # source://actionpack//lib/action_dispatch/routing/inspector.rb#58 class ActionDispatch::Routing::RoutesInspector # @return [RoutesInspector] a new instance of RoutesInspector # # source://actionpack//lib/action_dispatch/routing/inspector.rb#59 def initialize(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#64 def format(formatter, filter = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/routing/inspector.rb#117 def collect_engine_routes(route); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#104 def collect_routes(routes); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#93 def filter_routes(filter); end # source://actionpack//lib/action_dispatch/routing/inspector.rb#84 def normalize_filter(filter); end end # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#7 class ActionDispatch::Routing::RoutesProxy include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor # @return [RoutesProxy] a new instance of RoutesProxy # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#13 def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 def _routes; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(_arg0); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end # Returns the value of attribute routes. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 def routes; end # Sets the attribute routes # # @param value the value to set the attribute routes to. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 def routes=(_arg0); end # Returns the value of attribute scope. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 def scope; end # Sets the attribute scope # # @param value the value to set the attribute scope to. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 def scope=(_arg0); end # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#19 def url_options; end private # Keeps the part of the script name provided by the global # context via ENV["SCRIPT_NAME"], which `mount` doesn't know # about since it depends on the specific request, but use our # script name resolver for the mount point dependent part. # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#58 def merge_script_names(previous_script_name, new_script_name); end # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#30 def method_missing(method, *args); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#26 def respond_to_missing?(method, _); end class << self # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options=(value); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 def default_url_options?; end end end # source://actionpack//lib/action_dispatch/routing.rb#257 ActionDispatch::Routing::SEPARATORS = T.let(T.unsafe(nil), Array) # In config/routes.rb you define URL-to-controller mappings, but the reverse # is also possible: a URL can be generated from one of your routing definitions. # URL generation functionality is centralized in this module. # # See ActionDispatch::Routing for general information about routing and routes.rb. # # Tip: If you need to generate URLs from your models or some other place, # then ActionController::UrlFor is what you're looking for. Read on for # an introduction. In general, this module should not be included on its own, # as it is usually included by url_helpers (as in Rails.application.routes.url_helpers). # # == URL generation from parameters # # As you may know, some functions, such as ActionController::Base#url_for # and ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set # of parameters. For example, you've probably had the chance to write code # like this in one of your views: # # <%= link_to('Click here', controller: 'users', # action: 'new', message: 'Welcome!') %> # # => Click here # # link_to, and all other functions that require URL generation functionality, # actually use ActionController::UrlFor under the hood. And in particular, # they use the ActionController::UrlFor#url_for method. One can generate # the same path as the above example by using the following code: # # include UrlFor # url_for(controller: 'users', # action: 'new', # message: 'Welcome!', # only_path: true) # # => "/users/new?message=Welcome%21" # # Notice the only_path: true part. This is because UrlFor has no # information about the website hostname that your Rails app is serving. So if you # want to include the hostname as well, then you must also pass the :host # argument: # # include UrlFor # url_for(controller: 'users', # action: 'new', # message: 'Welcome!', # host: 'www.example.com') # # => "http://www.example.com/users/new?message=Welcome%21" # # By default, all controllers and views have access to a special version of url_for, # that already knows what the current hostname is. So if you use url_for in your # controllers or your views, then you don't need to explicitly pass the :host # argument. # # For convenience reasons, mailers provide a shortcut for ActionController::UrlFor#url_for. # So within mailers, you only have to type +url_for+ instead of 'ActionController::UrlFor#url_for' # in full. However, mailers don't have hostname information, and you still have to provide # the +:host+ argument or set the default host that will be used in all mailers using the # configuration option +config.action_mailer.default_url_options+. For more information on # url_for in mailers read the ActionMailer#Base documentation. # # # == URL generation for named routes # # UrlFor also allows one to access methods that have been auto-generated from # named routes. For example, suppose that you have a 'users' resource in your # config/routes.rb: # # resources :users # # This generates, among other things, the method users_path. By default, # this method is accessible from your controllers, views, and mailers. If you need # to access this auto-generated method from other places (such as a model), then # you can do that by including Rails.application.routes.url_helpers in your class: # # class User < ActiveRecord::Base # include Rails.application.routes.url_helpers # # def base_uri # user_path(self) # end # end # # User.find(1).base_uri # => "/users/1" # # source://actionpack//lib/action_dispatch/routing/url_for.rb#87 module ActionDispatch::Routing::UrlFor include ::ActionDispatch::Routing::PolymorphicRoutes extend ::ActiveSupport::Concern include GeneratedInstanceMethods mixes_in_class_methods GeneratedClassMethods # source://actionpack//lib/action_dispatch/routing/url_for.rb#106 def initialize(*_arg0, **_arg1, &_arg2); end # source://actionpack//lib/action_dispatch/routing/url_for.rb#173 def full_url_for(options = T.unsafe(nil)); end # Allows calling direct or regular named route. # # resources :buckets # # direct :recordable do |recording| # route_for(:bucket, recording.bucket) # end # # direct :threadable do |threadable| # route_for(:recordable, threadable.parent) # end # # This maintains the context of the original caller on # whether to return a path or full URL, e.g: # # threadable_path(threadable) # => "/buckets/1" # threadable_url(threadable) # => "http://example.com/buckets/1" # # source://actionpack//lib/action_dispatch/routing/url_for.rb#213 def route_for(name, *args); end # Generate a URL based on the options provided, default_url_options, and the # routes defined in routes.rb. The following options are supported: # # * :only_path - If true, the relative URL is returned. Defaults to +false+. # * :protocol - The protocol to connect to. Defaults to 'http'. # * :host - Specifies the host the link should be targeted at. # If :only_path is false, this option must be # provided either explicitly, or via +default_url_options+. # * :subdomain - Specifies the subdomain of the link, using the +tld_length+ # to split the subdomain from the host. # If false, removes all subdomains from the host part of the link. # * :domain - Specifies the domain of the link, using the +tld_length+ # to split the domain from the host. # * :tld_length - Number of labels the TLD id composed of, only used if # :subdomain or :domain are supplied. Defaults to # ActionDispatch::Http::URL.tld_length, which in turn defaults to 1. # * :port - Optionally specify the port to connect to. # * :anchor - An anchor name to be appended to the path. # * :params - The query parameters to be appended to the path. # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/" # * :script_name - Specifies application path relative to domain root. If provided, prepends application path. # # Any other key (:controller, :action, etc.) given to # +url_for+ is forwarded to the Routes module. # # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' # # => 'http://somehost.org:8080/tasks/testing' # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true # # => '/tasks/testing#ok' # url_for controller: 'tasks', action: 'testing', trailing_slash: true # # => 'http://somehost.org/tasks/testing/' # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' # # => 'http://somehost.org/tasks/testing?number=33' # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" # # => 'http://somehost.org/myapp/tasks/testing' # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true # # => '/myapp/tasks/testing' # # Missing routes keys may be filled in from the current request's parameters # (e.g. +:controller+, +:action+, +:id+, and any other parameters that are # placed in the path). Given that the current action has been reached # through GET /users/1: # # url_for(only_path: true) # => '/users/1' # url_for(only_path: true, action: 'edit') # => '/users/1/edit' # url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit' # # Notice that no +:id+ parameter was provided to the first +url_for+ call # and the helper used the one from the route's path. Any path parameter # implicitly used by +url_for+ can always be overwritten like shown on the # last +url_for+ calls. # # source://actionpack//lib/action_dispatch/routing/url_for.rb#169 def url_for(options = T.unsafe(nil)); end # Hook overridden in controller to add request information # with +default_url_options+. Application logic should not # go into url_options. # # source://actionpack//lib/action_dispatch/routing/url_for.rb#114 def url_options; end protected # @return [Boolean] # # source://actionpack//lib/action_dispatch/routing/url_for.rb#218 def optimize_routes_generation?; end private # source://actionpack//lib/action_dispatch/routing/url_for.rb#230 def _routes_context; end # source://actionpack//lib/action_dispatch/routing/url_for.rb#223 def _with_routes(routes); end module GeneratedClassMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end module GeneratedInstanceMethods def default_url_options; end def default_url_options=(value); end def default_url_options?; end end end # This middleware is added to the stack when config.force_ssl = true, and is passed # the options set in +config.ssl_options+. It does three jobs to enforce secure HTTP # requests: # # 1. TLS redirect: Permanently redirects +http://+ requests to +https://+ # with the same URL host, path, etc. Enabled by default. Set +config.ssl_options+ # to modify the destination URL # (e.g. redirect: { host: "secure.widgets.com", port: 8080 }), or set # redirect: false to disable this feature. # # Requests can opt-out of redirection with +exclude+: # # config.ssl_options = { redirect: { exclude: -> request { /healthcheck/.match?(request.path) } } } # # Cookies will not be flagged as secure for excluded requests. # # 2. Secure cookies: Sets the +secure+ flag on cookies to tell browsers they # must not be sent along with +http://+ requests. Enabled by default. Set # +config.ssl_options+ with secure_cookies: false to disable this feature. # # 3. HTTP Strict Transport Security (HSTS): Tells the browser to remember # this site as TLS-only and automatically redirect non-TLS requests. # Enabled by default. Configure +config.ssl_options+ with hsts: false to disable. # # Set +config.ssl_options+ with hsts: { ... } to configure HSTS: # # * +expires+: How long, in seconds, these settings will stick. The minimum # required to qualify for browser preload lists is 1 year. Defaults to # 2 years (recommended). # # * +subdomains+: Set to +true+ to tell the browser to apply these settings # to all subdomains. This protects your cookies from interception by a # vulnerable site on a subdomain. Defaults to +true+. # # * +preload+: Advertise that this site may be included in browsers' # preloaded HSTS lists. HSTS protects your site on every visit except the # first visit since it hasn't seen your HSTS header yet. To close this # gap, browser vendors include a baked-in list of HSTS-enabled sites. # Go to https://hstspreload.org to submit your site for inclusion. # Defaults to +false+. # # To turn off HSTS, omitting the header is not enough. Browsers will remember the # original HSTS directive until it expires. Instead, use the header to tell browsers to # expire HSTS immediately. Setting hsts: false is a shortcut for # hsts: { expires: 0 }. # # source://actionpack//lib/action_dispatch/middleware/ssl.rb#49 class ActionDispatch::SSL # @return [SSL] a new instance of SSL # # source://actionpack//lib/action_dispatch/middleware/ssl.rb#61 def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#73 def call(env); end private # https://tools.ietf.org/html/rfc6797#section-6.1 # # source://actionpack//lib/action_dispatch/middleware/ssl.rb#107 def build_hsts_header(hsts); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#114 def flag_cookies_as_secure!(headers); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#145 def https_location_for(request); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#92 def normalize_hsts_options(options); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#128 def redirect_to_https(request); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#135 def redirection_status(request); end # source://actionpack//lib/action_dispatch/middleware/ssl.rb#88 def set_hsts_header!(headers); end class << self # source://actionpack//lib/action_dispatch/middleware/ssl.rb#57 def default_hsts_options; end end end # Default to 2 years as recommended on hstspreload.org. # # source://actionpack//lib/action_dispatch/middleware/ssl.rb#53 ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) # source://actionpack//lib/action_dispatch/middleware/ssl.rb#55 ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#6 class ActionDispatch::ServerTiming # @return [ServerTiming] a new instance of ServerTiming # # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#52 def initialize(app); end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#58 def call(env); end class << self # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#48 def unsubscribe; end end end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#7 ActionDispatch::ServerTiming::SERVER_TIMING_HEADER = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#9 class ActionDispatch::ServerTiming::Subscriber include ::Singleton extend ::Singleton::SingletonClassMethods # @return [Subscriber] a new instance of Subscriber # # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#13 def initialize; end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#17 def call(event); end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#23 def collect_events; end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#32 def ensure_subscribed; end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#40 def unsubscribe; end class << self private def allocate; end def new(*_arg0); end end end # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#11 ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) # source://actionpack//lib/action_dispatch.rb#91 module ActionDispatch::Session; end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#90 class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure include ::ActionDispatch::Session::Compatibility include ::ActionDispatch::Session::StaleSessionCheck include ::ActionDispatch::Session::SessionObject # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#95 def generate_sid; end private # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#100 def set_cookie(request, response, cookie); end end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#79 class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted include ::ActionDispatch::Session::Compatibility include ::ActionDispatch::Session::StaleSessionCheck include ::ActionDispatch::Session::SessionObject private # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#85 def set_cookie(request, response, cookie); end end # A session store that uses an ActiveSupport::Cache::Store to store the sessions. This store is most useful # if you don't store critical data in your sessions and you don't need them to live for extended periods # of time. # # ==== Options # * cache - The cache to use. If it is not specified, Rails.cache will be used. # * expire_after - The length of time a session will be stored before automatically expiring. # By default, the :expires_in option of the cache is used. # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#15 class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore # @return [CacheStore] a new instance of CacheStore # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#16 def initialize(app, options = T.unsafe(nil)); end # Remove a session from the cache. # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#42 def delete_session(env, sid, options); end # Get a session from the cache. # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#23 def find_session(env, sid); end # Set a session in the cache. # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#31 def write_session(env, sid, session, options); end private # Turn the session id into a cache key. # # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#50 def cache_key(id); end # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#54 def get_session_with_fallback(sid); end end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#20 module ActionDispatch::Session::Compatibility # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#21 def initialize(app, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#26 def generate_sid; end private # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#33 def initialize_sid; end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#38 def make_request(env); end end # This cookie-based session store is the Rails default. It is # dramatically faster than the alternatives. # # Sessions typically contain at most a user ID and flash message; both fit # within the 4096 bytes cookie size limit. A +CookieOverflow+ exception is raised if # you attempt to store more than 4096 bytes of data. # # The cookie jar used for storage is automatically configured to be the # best possible option given your application's configuration. # # Your cookies will be encrypted using your application's +secret_key_base+. This # goes a step further than signed cookies in that encrypted cookies cannot # be altered or read by users. This is the default starting in Rails 4. # # Configure your session store in an initializer: # # Rails.application.config.session_store :cookie_store, key: '_your_app_session' # # In the development and test environments your application's +secret_key_base+ is # generated by Rails and stored in a temporary file in tmp/development_secret.txt. # In all other environments, it is stored encrypted in the # config/credentials.yml.enc file. # # If your application was not updated to Rails 5.2 defaults, the +secret_key_base+ # will be found in the old config/secrets.yml file. # # Note that changing your +secret_key_base+ will invalidate all existing session. # Additionally, you should take care to make sure you are not relying on the # ability to decode signed cookies generated by your app in external # applications or JavaScript before changing it. # # Because CookieStore extends +Rack::Session::Abstract::Persisted+, many of the # options described there can be used to customize the session cookie that # is generated. For example: # # Rails.application.config.session_store :cookie_store, expire_after: 14.days # # would set the session cookie to expire automatically 14 days after creation. # Other useful options include :key, :secure, # :httponly, and :same_site. # # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#49 class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore # @return [CookieStore] a new instance of CookieStore # # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#59 def initialize(app, options = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#63 def delete_session(req, session_id, options); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#70 def load_session(req); end private # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#117 def cookie_jar(request); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#79 def extract_session_id(req); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#113 def get_cookie(req); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#98 def persistent_session_id!(data, sid = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#109 def set_cookie(request, session_id, cookie); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#86 def unpacked_cookie_data(req); end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#104 def write_session(req, sid, session_data, options); end end # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#50 class ActionDispatch::Session::CookieStore::SessionId # @return [SessionId] a new instance of SessionId # # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#53 def initialize(session_id, cookie_value = T.unsafe(nil)); end # Returns the value of attribute cookie_value. # # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#51 def cookie_value; end end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#69 module ActionDispatch::Session::SessionObject # @return [Boolean] # # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#74 def loaded_session?(session); end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#70 def prepare_session(req); end end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#11 class ActionDispatch::Session::SessionRestoreError < ::StandardError # @return [SessionRestoreError] a new instance of SessionRestoreError # # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#12 def initialize; end end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#43 module ActionDispatch::Session::StaleSessionCheck # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#48 def extract_session_id(env); end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#44 def load_session(env); end # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#52 def stale_session_check!; end end # This middleware rescues any exception returned by the application # and calls an exceptions app that will wrap it in a format for the end user. # # The exceptions app should be passed as parameter on initialization # of ShowExceptions. Every time there is an exception, ShowExceptions will # store the exception in env["action_dispatch.exception"], rewrite the # PATH_INFO to the exception status code and call the Rack app. # # If the application returns a "X-Cascade" pass response, this middleware # will send an empty response as result with the correct status code. # If any exception happens inside the exceptions app, this middleware # catches the exceptions and returns a failsafe response. # # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#18 class ActionDispatch::ShowExceptions # @return [ShowExceptions] a new instance of ShowExceptions # # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#19 def initialize(app, exceptions_app); end # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#24 def call(env); end private # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#58 def fallback_to_html_format_if_invalid_mime_type(request); end # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#67 def pass_response(status); end # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#36 def render_exception(request, exception); end end # This middleware serves static files from disk, if available. # If no file is found, it hands off to the main app. # # In Rails apps, this middleware is configured to serve assets from # the +public/+ directory. # # Only GET and HEAD requests are served. POST and other HTTP methods # are handed off to the main app. # # Only files in the root directory are served; path traversal is denied. # # source://actionpack//lib/action_dispatch/middleware/static.rb#16 class ActionDispatch::Static # @return [Static] a new instance of Static # # source://actionpack//lib/action_dispatch/middleware/static.rb#17 def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/middleware/static.rb#22 def call(env); end end # source://actionpack//lib/action_dispatch/testing/test_process.rb#7 module ActionDispatch::TestProcess include ::ActionDispatch::TestProcess::FixtureFile # @raise [NoMethodError] # # source://actionpack//lib/action_dispatch/testing/test_process.rb#30 def assigns(key = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/testing/test_process.rb#44 def cookies; end # source://actionpack//lib/action_dispatch/testing/test_process.rb#40 def flash; end # source://actionpack//lib/action_dispatch/testing/test_process.rb#48 def redirect_to_url; end # source://actionpack//lib/action_dispatch/testing/test_process.rb#36 def session; end end # source://actionpack//lib/action_dispatch/testing/test_process.rb#8 module ActionDispatch::TestProcess::FixtureFile # Shortcut for Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type): # # post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png') } # # Default fixture files location is test/fixtures/files. # # To upload binary files on Windows, pass :binary as the last parameter. # This will not affect other platforms: # # post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png', :binary) } # # source://actionpack//lib/action_dispatch/testing/test_process.rb#19 def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end end # source://actionpack//lib/action_dispatch/testing/test_request.rb#7 class ActionDispatch::TestRequest < ::ActionDispatch::Request # source://actionpack//lib/action_dispatch/testing/test_request.rb#66 def accept=(mime_types); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#46 def action=(action_name); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#30 def host=(host); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#50 def if_modified_since=(last_modified); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#54 def if_none_match=(etag); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#42 def path=(path); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#34 def port=(number); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#58 def remote_addr=(addr); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#26 def request_method=(method); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#38 def request_uri=(uri); end # source://actionpack//lib/action_dispatch/testing/test_request.rb#62 def user_agent=(user_agent); end class << self # Create a new test request with default +env+ values. # # source://actionpack//lib/action_dispatch/testing/test_request.rb#15 def create(env = T.unsafe(nil)); end private # source://actionpack//lib/action_dispatch/testing/test_request.rb#21 def default_env; end end end # source://actionpack//lib/action_dispatch/testing/test_request.rb#8 ActionDispatch::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) # Integration test methods such as Integration::RequestHelpers#get # and Integration::RequestHelpers#post return objects of class # TestResponse, which represent the HTTP response results of the requested # controller actions. # # See Response for more information on controller response objects. # # source://actionpack//lib/action_dispatch/testing/test_response.rb#12 class ActionDispatch::TestResponse < ::ActionDispatch::Response # Returns a parsed body depending on the response MIME type. When a parser # corresponding to the MIME type is not found, it returns the raw body. # # ==== Examples # get "/posts" # response.content_type # => "text/html; charset=utf-8" # response.parsed_body.class # => String # response.parsed_body # => "\n\n..." # # get "/posts.json" # response.content_type # => "application/json; charset=utf-8" # response.parsed_body.class # => Array # response.parsed_body # => [{"id"=>42, "title"=>"Title"},... # # get "/posts/42.json" # response.content_type # => "application/json; charset=utf-8" # response.parsed_body.class # => Hash # response.parsed_body # => {"id"=>42, "title"=>"Title"} # # source://actionpack//lib/action_dispatch/testing/test_response.rb#35 def parsed_body; end # source://actionpack//lib/action_dispatch/testing/test_response.rb#39 def response_parser; end class << self # source://actionpack//lib/action_dispatch/testing/test_response.rb#13 def from_response(response); end end end # source://actionpack//lib/action_pack/gem_version.rb#3 module ActionPack class << self # Returns the currently loaded version of Action Pack as a Gem::Version. # # source://actionpack//lib/action_pack/gem_version.rb#5 def gem_version; end # Returns the currently loaded version of Action Pack as a Gem::Version. # # source://actionpack//lib/action_pack/version.rb#7 def version; end end end # source://actionpack//lib/action_pack/gem_version.rb#9 module ActionPack::VERSION; end # source://actionpack//lib/action_pack/gem_version.rb#10 ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) # source://actionpack//lib/action_pack/gem_version.rb#11 ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) # source://actionpack//lib/action_pack/gem_version.rb#13 ActionPack::VERSION::PRE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_pack/gem_version.rb#15 ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_pack/gem_version.rb#12 ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) module ActionView::RoutingUrlFor include ::ActionDispatch::Routing::PolymorphicRoutes include ::ActionDispatch::Routing::UrlFor end # source://actionpack//lib/action_dispatch/http/mime_type.rb#5 module Mime class << self # source://actionpack//lib/action_dispatch/http/mime_type.rb#40 def [](type); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#45 def fetch(type, &block); end end end # ALL isn't a real MIME type, so we don't register it for lookup with the # other concrete types. It's a wildcard match that we use for +respond_to+ # negotiation internals. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#333 Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) # source://actionpack//lib/action_dispatch/http/mime_type.rb#319 class Mime::AllType < ::Mime::Type include ::Singleton extend ::Singleton::SingletonClassMethods # @return [AllType] a new instance of AllType # # source://actionpack//lib/action_dispatch/http/mime_type.rb#322 def initialize; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#326 def all?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#327 def html?; end class << self private def allocate; end def new(*_arg0); end end end # source://actionpack//lib/action_dispatch/http/mime_type.rb#36 Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/mime_type.rb#37 Mime::LOOKUP = T.let(T.unsafe(nil), Hash) # source://actionpack//lib/action_dispatch/http/mime_type.rb#6 class Mime::Mimes include ::Enumerable # @return [Mimes] a new instance of Mimes # # source://actionpack//lib/action_dispatch/http/mime_type.rb#11 def initialize; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#20 def <<(type); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#25 def delete_if; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#16 def each(&block); end # Returns the value of attribute symbols. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#7 def symbols; end end # source://actionpack//lib/action_dispatch/http/mime_type.rb#335 class Mime::NullType include ::Singleton extend ::Singleton::SingletonClassMethods # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#338 def nil?; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#346 def ref; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#342 def to_s; end private # source://actionpack//lib/action_dispatch/http/mime_type.rb#353 def method_missing(method, *args); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#349 def respond_to_missing?(method, _); end class << self private def allocate; end def new(*_arg0); end end end # source://actionpack//lib/action_dispatch/http/mime_type.rb#35 Mime::SET = T.let(T.unsafe(nil), Mime::Mimes) # Encapsulates the notion of a MIME type. Can be used at render time, for example, with: # # class PostsController < ActionController::Base # def show # @post = Post.find(params[:id]) # # respond_to do |format| # format.html # format.ics { render body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") } # format.xml { render xml: @post } # end # end # end # # source://actionpack//lib/action_dispatch/http/mime_type.rb#64 class Mime::Type # @return [Type] a new instance of Type # # source://actionpack//lib/action_dispatch/http/mime_type.rb#234 def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#267 def ==(mime_type); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#259 def ===(list); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#281 def =~(mime_type); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#297 def all?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#274 def eql?(other); end # Returns the value of attribute hash. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#225 def hash; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#293 def html?; end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#287 def match?(mime_type); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#255 def ref; end # Returns the value of attribute symbol. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#65 def symbol; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#243 def to_s; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#247 def to_str; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#251 def to_sym; end protected # Returns the value of attribute string. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#300 def string; end # Returns the value of attribute synonyms. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#300 def synonyms; end private # source://actionpack//lib/action_dispatch/http/mime_type.rb#306 def method_missing(method, *args); end # @return [Boolean] # # source://actionpack//lib/action_dispatch/http/mime_type.rb#314 def respond_to_missing?(method, include_private = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#304 def to_a; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#303 def to_ary; end class << self # source://actionpack//lib/action_dispatch/http/mime_type.rb#144 def lookup(string); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#148 def lookup_by_extension(extension); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#172 def parse(accept_header); end # For an input of 'text', returns [Mime[:json], Mime[:xml], Mime[:ics], # Mime[:html], Mime[:css], Mime[:csv], Mime[:js], Mime[:yaml], Mime[:text]. # # For an input of 'application', returns [Mime[:html], Mime[:js], # Mime[:xml], Mime[:yaml], Mime[:atom], Mime[:json], Mime[:rss], Mime[:url_encoded_form]. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#206 def parse_data_with_trailing_star(type); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#197 def parse_trailing_star(accept_header); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#158 def register(string, symbol, mime_type_synonyms = T.unsafe(nil), extension_synonyms = T.unsafe(nil), skip_lookup = T.unsafe(nil)); end # Registers an alias that's not used on MIME type lookup, but can be referenced directly. Especially useful for # rendering different HTML versions depending on the user agent, like an iPhone. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#154 def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#140 def register_callback(&block); end # This method is opposite of register method. # # To unregister a MIME type: # # Mime::Type.unregister(:mobile) # # source://actionpack//lib/action_dispatch/http/mime_type.rb#215 def unregister(symbol); end end end # A simple helper class used in parsing the accept header. # # source://actionpack//lib/action_dispatch/http/mime_type.rb#70 class Mime::Type::AcceptItem # @return [AcceptItem] a new instance of AcceptItem # # source://actionpack//lib/action_dispatch/http/mime_type.rb#74 def initialize(index, name, q = T.unsafe(nil)); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#81 def <=>(item); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def index; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def index=(_arg0); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def name; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def name=(_arg0); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def q; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def q=(_arg0); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 def to_s; end end # source://actionpack//lib/action_dispatch/http/mime_type.rb#88 class Mime::Type::AcceptList class << self # source://actionpack//lib/action_dispatch/http/mime_type.rb#131 def find_item_by_name(array, name); end # source://actionpack//lib/action_dispatch/http/mime_type.rb#89 def sort!(list); end end end # source://actionpack//lib/action_dispatch/http/mime_type.rb#232 class Mime::Type::InvalidMimeType < ::StandardError; end # source://actionpack//lib/action_dispatch/http/mime_type.rb#227 Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/mime_type.rb#229 Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/mime_type.rb#228 Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) # source://actionpack//lib/action_dispatch/http/mime_type.rb#230 Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) # source://actionpack//lib/action_dispatch.rb#33 module Rack class << self # source://rack/2.2.6.4/lib/rack/version.rb#26 def release; end # source://rack/2.2.6.4/lib/rack/version.rb#19 def version; end end end