Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document delegated public methods on AC::Parameters #28334

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
71 changes: 71 additions & 0 deletions actionpack/lib/action_controller/metal/strong_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,77 @@ class Parameters

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

Expand Down