Class: NamedRoutes::SchemedUri
- Inherits:
-
Object
- Object
- NamedRoutes::SchemedUri
- Defined in:
- lib/named-routes/schemed_uri.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
-
#initialize(routes, scheme) ⇒ SchemedUri
constructor
A new instance of SchemedUri.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(routes, scheme) ⇒ SchemedUri
Returns a new instance of SchemedUri.
5 6 7 |
# File 'lib/named-routes/schemed_uri.rb', line 5 def initialize(routes, scheme) @routes, @scheme = routes, scheme end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
9 10 11 |
# File 'lib/named-routes/schemed_uri.rb', line 9 def method_missing(method_name, *args, &block) "#{scheme}://#{routes.host}#{routes.send(method_name, *args, &block)}" end |
Instance Attribute Details
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
3 4 5 |
# File 'lib/named-routes/schemed_uri.rb', line 3 def routes @routes end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
3 4 5 |
# File 'lib/named-routes/schemed_uri.rb', line 3 def scheme @scheme end |