Class: MrMime::UrlResolver
- Inherits:
-
Object
- Object
- MrMime::UrlResolver
- Defined in:
- app/models/mr_mime/url_resolver.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ UrlResolver
constructor
A new instance of UrlResolver.
- #resolve ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ UrlResolver
Returns a new instance of UrlResolver.
9 10 11 12 13 |
# File 'app/models/mr_mime/url_resolver.rb', line 9 def initialize(url, = {}) @url = evaluate(url, *[:args]) @context = [:context] @default = [:default] end |
Class Method Details
.resolve(*args) ⇒ Object
5 6 7 |
# File 'app/models/mr_mime/url_resolver.rb', line 5 def self.resolve(*args) new(*args).resolve end |
Instance Method Details
#resolve ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/mr_mime/url_resolver.rb', line 15 def resolve case when method_name? then main_app.send(url) when url_name? then url else default end end |