Skip to content

Commit

Permalink
Base#[] doc params as_jsi, use_default
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Jul 22, 2023
1 parent 24a9a6b commit 1b1a8a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/jsi/base.rb
Expand Up @@ -437,9 +437,10 @@ def jsi_default_child(token, as_jsi: )
#
# @param token [String, Integer, Object] an array index or hash key (JSON object property name)
# of the instance identifying the child value
# @param as_jsi [:auto, true, false] whether to return the result value as a JSI. one of:
# @param as_jsi [:auto, true, false] (default is `:auto`)
# Whether to return the child as a JSI. One of:
#
# - :auto (default): by default a JSI will be returned when either:
# - `:auto`: By default a JSI will be returned when either:
#
# - the result is a complex value (responds to #to_ary or #to_hash)
# - the result is a schema (including true/false schemas)
Expand All @@ -454,8 +455,9 @@ def jsi_default_child(token, as_jsi: )
# is not a hash key or array index of the instance and no default value applies.
# (one exception is when this JSI's instance is a Hash with a default or default_proc, which has
# unspecified behavior.)
# @param use_default [true, false] whether to return a schema default value when the token is not in
# range. if the token is not an array index or hash key of the instance, and one schema for the child
# @param use_default [true, false] (default is `false`)
# Whether to return a schema default value when the token refers to a child that is not in the document.
# If the token is not an array index or hash key of the instance, and one schema for the child
# instance specifies a default value, that default is returned.
#
# if the result with the default value is a JSI (per the `as_jsi` param), that JSI is not a child of
Expand Down

0 comments on commit 1b1a8a3

Please sign in to comment.