Class: Adrift::Pattern::Tags::Id

Inherits:
Object
  • Object
show all
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

Instance Method Details

#labelObject

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(options={})
  options[:attachment].model.id.to_s
end