Skip to content

Instantly share code, notes, and snippets.

@Shinya131
Last active December 14, 2015 02:19
Show Gist options
  • Save Shinya131/5013188 to your computer and use it in GitHub Desktop.
Save Shinya131/5013188 to your computer and use it in GitHub Desktop.
以下の3つの違いについて調べてみた記録 Rack::Request, ActionDispatch::Request, ActionDispatch::Request(gem 'jpmobile'した場合)
### 1) Rack::Request, ActionDispatch::Request(plain rails) diff
Rack::Request.instance_methods.count #=> 154
ActionDispatch::Request.instance_methods.count #=> 231
ActionDispatch::Request.instance_methods - Rack::Request.instance_methods
#=> [:ignore_accept_header, :ignore_accept_header=, :auth_type, :gateway_interface,
# :path_translated, :remote_host, :remote_ident, :remote_user, :remote_addr,
# :server_name, :server_protocol, :accept, :accept_charset, :accept_language,
# :cache_control, :from, :negotiate, :pragma, :key?, :request_method_symbol,
# :method_symbol, :headers, :original_fullpath, :original_url, :xml_http_request?,
# :remote_ip, :uuid, :server_software, :raw_post, :body_stream, :reset_session,
# :session=, :session_options=, :query_parameters, :request_parameters, :authorization,
# :local?, :deep_munge, :cookie_jar, :flash, :tld_length, :tld_length=, :protocol,
# :raw_host_with_port, :standard_port, :standard_port?, :optional_port, :port_string,
# :server_port, :domain, :subdomains, :subdomain, :filtered_parameters, :filtered_env,
# :filtered_path, :parameter_filter, :env_filter, :parameter_filter_for, :filtered_query_string,
# :parameters, :path_parameters=, :symbolized_path_parameters, :path_parameters,
# :reset_parameters, :content_mime_type, :accepts, :format, :formats, :format=, :negotiate_mime,
# :valid_accept_header, :use_accept_header, :if_modified_since, :if_none_match, :not_modified?,
# :etag_matches?, :fresh?]
### 2) ActionDispatch::Request(plain rails), ActionDispatch::Request(expanded by jpmobile) diff
methods_of_expanded_by_jpmobile.count #=> 235
ActionDispatch::Request.instance_methods.count #=> 231
methods_of_expanded_by_jpmobile - ActionDispatch::Request.instance_methods
# => [:user_agent=, :mobile?, :smart_phone?, :mobile]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment