aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/strong_parameters.rb
diff options
context:
space:
mode:
authorJon Moss <maclover7@users.noreply.github.com>2017-03-07 18:56:11 -0500
committerGitHub <noreply@github.com>2017-03-07 18:56:11 -0500
commita906c8c75aba0fdcddeb98c4c8413510c2a2e1dc (patch)
tree917d1fda4b3d5915d069b2059a6657dba2e07d8f /actionpack/lib/action_controller/metal/strong_parameters.rb
parent355a2fcfe9d76ece068d2df7b51fe71863cb9e51 (diff)
parent830ed5a5362ee4547fcbb3e3c66b08f5e1afa391 (diff)
downloadrails-a906c8c75aba0fdcddeb98c4c8413510c2a2e1dc.tar.gz
rails-a906c8c75aba0fdcddeb98c4c8413510c2a2e1dc.tar.bz2
rails-a906c8c75aba0fdcddeb98c4c8413510c2a2e1dc.zip
Merge pull request #28334 from tjschuck/document_delegated_params_methods
Document delegated public methods on AC::Parameters
Diffstat (limited to 'actionpack/lib/action_controller/metal/strong_parameters.rb')
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb71
1 files changed, 71 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index 3b293baa73..563c3c0e59 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -112,6 +112,77 @@ module ActionController
cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false
+ ##
+ # :method: as_json
+ #
+ # :call-seq:
+ # as_json(options=nil)
+ #
+ # Returns a hash that can be used as the JSON representation for the params.
+
+ ##
+ # :method: empty?
+ #
+ # :call-seq:
+ # empty?()
+ #
+ # Returns true if the object has no key/value pairs.
+
+ ##
+ # :method: has_key?
+ #
+ # :call-seq:
+ # has_key?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+
+ ##
+ # :method: has_value?
+ #
+ # :call-seq:
+ # has_value?(value)
+ #
+ # Returns true if the given value is present for some key in the parameters.
+
+ ##
+ # :method: include?
+ #
+ # :call-seq:
+ # include?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+
+ ##
+ # :method: key?
+ #
+ # :call-seq:
+ # key?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+
+ ##
+ # :method: keys
+ #
+ # :call-seq:
+ # keys()
+ #
+ # Returns a new array of the keys of the parameters.
+
+ ##
+ # :method: value?
+ #
+ # :call-seq:
+ # value?(value)
+ #
+ # Returns true if the given value is present for some key in the parameters.
+
+ ##
+ # :method: values
+ #
+ # :call-seq:
+ # values()
+ #
+ # Returns a new array of the values of the parameters.
delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?, :include?,
:as_json, to: :@parameters