Method: PathTo::Path#merge_http_options

Defined in:
lib/path-to/path.rb

#merge_http_options(args) ⇒ Object

Include application.http_options (if exists) in args, either appending it or reverse-merging with the last element of args if it’s a Hash



75
76
77
78
79
80
81
82
83
84
# File 'lib/path-to/path.rb', line 75

def merge_http_options(args)
  if (http_options = application.http_options)
    if args[-1].kind_of?(Hash)
      args[-1] = http_options.merge(args[-1])
    else
      args << http_options
    end
  end
  args
end