Class: Restful::UrlFactory
- Inherits:
-
Object
- Object
- Restful::UrlFactory
- Defined in:
- lib/restful/serializer.rb
Overview
Enables local generation of named_routes with preset arguments:
-
:api_prefix
-
:default_url_options
Used by Serializer and Association to customize urls for their WebService.
Instance Attribute Summary collapse
-
#api_prefix ⇒ Object
Returns the value of attribute api_prefix.
-
#default_url_options ⇒ Object
Returns the value of attribute default_url_options.
Instance Method Summary collapse
-
#create(options) ⇒ Object
Url.for but with UrlFactory’s options slipped in.
-
#initialize(options) ⇒ UrlFactory
constructor
A new instance of UrlFactory.
Constructor Details
#initialize(options) ⇒ UrlFactory
Returns a new instance of UrlFactory.
15 16 17 18 |
# File 'lib/restful/serializer.rb', line 15 def initialize() self.api_prefix = [:api_prefix] self. = [:default_url_options] || {} end |
Instance Attribute Details
#api_prefix ⇒ Object
Returns the value of attribute api_prefix.
13 14 15 |
# File 'lib/restful/serializer.rb', line 13 def api_prefix @api_prefix end |
#default_url_options ⇒ Object
Returns the value of attribute default_url_options.
13 14 15 |
# File 'lib/restful/serializer.rb', line 13 def @default_url_options end |