Skip to content

Commit

Permalink
Final small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krzykamil committed Aug 12, 2024
1 parent 9a264e1 commit 7733380
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
19 changes: 0 additions & 19 deletions lib/hanami/action/request_params/action_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ def self.included(klass)
klass.send :prepend, ActionValidations
end

# Returns raw params from Rack env
#
# @return [Hash]
#
# @since 2.2.0
def raw
@input
end

# Returns structured error messages
#
# @return [Hash]
Expand Down Expand Up @@ -195,16 +186,6 @@ def valid?
errors.empty?
end

# Serialize validated params to Hash
#
# @return [::Hash]
#
# @since 2.2.0
def to_h
@params
end
alias_method :to_hash, :to_h

# Pattern-matching support
#
# @return [::Hash]
Expand Down
19 changes: 14 additions & 5 deletions lib/hanami/action/request_params/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module RequestParams
# since 2.2.0
# @api private
module Base
# @since 0.7.0
# @since 2.2.0
# @api public
def get(*keys)
@params.dig(*keys)
Expand All @@ -23,14 +23,23 @@ def get(*keys)
# This is for compatibility with Hanami::Helpers::FormHelper::Values
#
# @api private
# @since 0.8.0
# @since 2.2.0
alias_method :dig, :get

# Returns raw params from Rack env
#
# @return [Hash]
#
# @since 2.2.0
def raw
@input
end

# Returns a hash of the parsed request params.
#
# @return [Hash]
#
# @since 0.7.0
# @since 2.2.0
# @api public
def to_h
@params
Expand All @@ -46,7 +55,7 @@ def to_h
#
# @return [to_h]
#
# @since 0.7.1
# @since 2.2.0
# @api public
def each(&blk)
to_h.each(&blk)
Expand All @@ -58,7 +67,7 @@ def each(&blk)
#
# @return [Object,nil] the associated value, if found
#
# @since 0.7.0
# @since 2.2.0
# @api public
def [](key)
@params[key]
Expand Down

0 comments on commit 7733380

Please sign in to comment.