lib/apia/argument_set.rb
# This is a constant that represents a missing value where `nil` means
# the user actually wanted to send null/nil.
This is a constant that represents a missing value where `nil` means
the user actually wanted to send null/nil.
This is a constant that represents a missing value where ` nil ` means the user actually wanted to send null / nil .
def value_from_route(argument, request)
      return MissingValue.singleton if request.nil?
      return MissingValue.singleton if request.route.nil?
      route_args = request.route.extract_arguments(request.api_path)
      unless route_args.key?(argument.name.to_s)
        return MissingValue.singleton
      end
      value_for_arg = route_args[argument.name.to_s]
      return nil if value_for_arg.nil?
      if argument.type.argument_set?
        if first_arg = argument.type.klass.definition.arguments.keys.first
          { first_arg.to_s => value_for_arg }
        else
          {}
        end
      else
        value_for_arg
      end
    end
def value_from_route ( argument , request ) return MissingValue . singleton if request . nil? return MissingValue . singleton if request . route . nil? route_args = request . route . extract_arguments ( request . api_path ) unless route_args . key? ( argument . name . to_s ) return MissingValue . singleton end value_for_arg = route_args [ argument . name . to_s ] return nil if value_for_arg . nil? if argument . type . argument_set? if first_arg = argument . type . klass . definition . arguments . keys . first { first_arg . to_s => value_for_arg } else { } end else value_for_arg end end
This is a constant that represents a missing value where `nil` means
the user actually wanted to send null/nil.
This is a constant that represents a missing value where ` nil ` means the user actually wanted to send null / nil .
# If the argument is an argument set, we'll just want to try and # populate the first argument.
argument
<not_specific>
request
<not_specific>