Class: Adrift::Pattern::Tags::Id
- Inherits:
-
Object
- Object
- Adrift::Pattern::Tags::Id
- Defined in:
- lib/adrift/pattern.rb
Overview
Pattern’s tag that allows to generally express the model’s to which the Attachment belongs ID.
Instance Method Summary collapse
-
#label ⇒ Object
Portion of Pattern#string that will be replaced.
-
#specialize(options = {}) ⇒ Object
Model’s ID.
Instance Method Details
#label ⇒ Object
Portion of Pattern#string that will be replaced.
108 109 110 |
# File 'lib/adrift/pattern.rb', line 108 def label ':id' end |
#specialize(options = {}) ⇒ Object
Model’s ID. Expects options
to include the Attachment (:attachment
key).
114 115 116 |
# File 'lib/adrift/pattern.rb', line 114 def specialize(={}) [:attachment].model.id.to_s end |