Sha256: 496be5fa96969ae46c4479b95dcae2412dfc13a7f3c7a431aadb697cd81cb145

Contents?: true

Size: 433 Bytes

Versions: 2

Compression:

Stored size: 433 Bytes

Contents

module Prosperity::MainAppRouteDelegator
  # delegate url helpers to main_app
  def method_missing(method, *args, &block)
    if main_app_route_method?(method)
      main_app.send(method, *args)
    else
      super
    end
  end

  def respond_to?(method)
    super || main_app_route_method?(method)
  end

  private
  def main_app_route_method?(method)
    method.to_s =~ /_(?:path|url)$/ && main_app.respond_to?(method)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prosperity-0.0.11 lib/prosperity/main_app_route_delegator.rb
prosperity-0.0.10 lib/prosperity/main_app_route_delegator.rb