module MotionHybrid::Navigatable::ClassMethods

Public Instance Methods

path_for(url) click to toggle source
# File lib/motion-hybrid/concerns/navigatable.rb, line 129
def path_for(url)
  return if url.blank?
  nsurl = NSURL.URLWithString(url)
  url = url.sub("#{nsurl.scheme}://#{nsurl.host}", '')
  url = url.sub(":#{nsurl.port}", '') if nsurl.port
  url
end
request_for(path) click to toggle source
# File lib/motion-hybrid/concerns/navigatable.rb, line 125
def request_for(path)
  NSURLRequest.requestWithURL NSURL.URLWithString(url_for(path))
end
route(*patterns, &block) click to toggle source
# File lib/motion-hybrid/concerns/navigatable.rb, line 137
def route(*patterns, &block)
  patterns.each do |pattern|
    self.routes = [Route.new(pattern, &block)] + routes
  end
end
url_for(path) click to toggle source
# File lib/motion-hybrid/concerns/navigatable.rb, line 121
def url_for(path)
  "#{root_url}#{path}"
end