Use casecmp?() instead of casecmp().zero?
This commit is contained in:
parent
392d3d1226
commit
a082caef3c
3 changed files with 4 additions and 4 deletions
|
@ -181,7 +181,7 @@ class ApplicationController < ActionController::Base
|
||||||
# TODO: some sort of escaping of problem characters in the message
|
# TODO: some sort of escaping of problem characters in the message
|
||||||
response.headers["Error"] = message
|
response.headers["Error"] = message
|
||||||
|
|
||||||
if request.headers["X-Error-Format"]&.casecmp("xml")&.zero?
|
if request.headers["X-Error-Format"]&.casecmp?("xml")
|
||||||
result = OSM::API.new.xml_doc
|
result = OSM::API.new.xml_doc
|
||||||
result.root.name = "osmError"
|
result.root.name = "osmError"
|
||||||
result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
|
result.root << (XML::Node.new("status") << "#{Rack::Utils.status_code(status)} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
|
||||||
|
|
|
@ -225,12 +225,12 @@ class GeocoderController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_decdeg(captures)
|
def to_decdeg(captures)
|
||||||
ns = captures.fetch("ns").casecmp("s").zero? ? -1 : 1
|
ns = captures.fetch("ns").casecmp?("s") ? -1 : 1
|
||||||
nsd = BigDecimal(captures.fetch("nsd", "0"))
|
nsd = BigDecimal(captures.fetch("nsd", "0"))
|
||||||
nsm = BigDecimal(captures.fetch("nsm", "0"))
|
nsm = BigDecimal(captures.fetch("nsm", "0"))
|
||||||
nss = BigDecimal(captures.fetch("nss", "0"))
|
nss = BigDecimal(captures.fetch("nss", "0"))
|
||||||
|
|
||||||
ew = captures.fetch("ew").casecmp("w").zero? ? -1 : 1
|
ew = captures.fetch("ew").casecmp?("w") ? -1 : 1
|
||||||
ewd = BigDecimal(captures.fetch("ewd", "0"))
|
ewd = BigDecimal(captures.fetch("ewd", "0"))
|
||||||
ewm = BigDecimal(captures.fetch("ewm", "0"))
|
ewm = BigDecimal(captures.fetch("ewm", "0"))
|
||||||
ews = BigDecimal(captures.fetch("ews", "0"))
|
ews = BigDecimal(captures.fetch("ews", "0"))
|
||||||
|
|
|
@ -73,7 +73,7 @@ class RequestToken < OauthToken
|
||||||
end
|
end
|
||||||
|
|
||||||
def oob?
|
def oob?
|
||||||
callback_url.nil? || callback_url.casecmp("oob").zero?
|
callback_url.nil? || callback_url.casecmp?("oob")
|
||||||
end
|
end
|
||||||
|
|
||||||
def oauth10?
|
def oauth10?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue