Class: Alchemy::Attachment::Url
- Inherits:
-
Object
- Object
- Alchemy::Attachment::Url
- Defined in:
- app/models/alchemy/attachment/url.rb
Overview
The class representing an URL to an attachment
Set a different one
Alchemy::Attachment.url_class = MyRemoteUrlClass
Instance Method Summary collapse
-
#call(options = {}) ⇒ String
The attachment url.
-
#initialize(attachment) ⇒ Url
constructor
A new instance of Url.
Constructor Details
#initialize(attachment) ⇒ Url
Returns a new instance of Url.
12 13 14 |
# File 'app/models/alchemy/attachment/url.rb', line 12 def initialize() @attachment = end |
Instance Method Details
#call(options = {}) ⇒ String
The attachment url
25 26 27 28 29 30 31 32 |
# File 'app/models/alchemy/attachment/url.rb', line 25 def call( = {}) [:format] ||= @attachment.suffix if .delete(:download) routes.(@attachment, ) else routes.(@attachment, ) end end |