module MyJohnDeereApi::Helpers::UriHelpers

Private Instance Methods

id_from_uri(uri, label) click to toggle source

infer id from uri

# File lib/my_john_deere_api/helpers/uri_helpers.rb, line 15
def id_from_uri(uri, label)
  parts = uri.split('/')
  parts[parts.index(label.to_s) + 1]
end
uri_path(uri) click to toggle source

extract just the path from the uri, excluding the platform prefix

# File lib/my_john_deere_api/helpers/uri_helpers.rb, line 8
def uri_path(uri)
  URI.parse(uri).path
end