Class: Adrift::Pattern::Tags::Extension
- Inherits:
-
Object
- Object
- Adrift::Pattern::Tags::Extension
- Defined in:
- lib/adrift/pattern.rb
Overview
Pattern’s tag that allows to generally express the Attachment’s extension.
Instance Method Summary collapse
-
#label ⇒ Object
Portion of Pattern#string that will be replaced.
-
#specialize(options = {}) ⇒ Object
Attachment’s file extension.
Instance Method Details
#label ⇒ Object
Portion of Pattern#string that will be replaced.
172 173 174 |
# File 'lib/adrift/pattern.rb', line 172 def label ':extension' end |
#specialize(options = {}) ⇒ Object
Attachment’s file extension. Expects options
to include the Attachment (:attachment
key).
178 179 180 |
# File 'lib/adrift/pattern.rb', line 178 def specialize(={}) File.extname([:attachment].filename.to_s).sub('.', '') end |