Class: Adrift::Pattern::Tags::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/adrift/pattern.rb

Overview

Pattern’s tag that allows to generally express the Attachment’s name.

Instance Method Summary collapse

Instance Method Details

#labelObject

Portion of Pattern#string that will be replaced.



31
32
33
# File 'lib/adrift/pattern.rb', line 31

def label
  ':attachment'
end

#specialize(options = {}) ⇒ Object

Pluralized Attachment’s name. Expects options to include the Attachment (:attachment key).



37
38
39
# File 'lib/adrift/pattern.rb', line 37

def specialize(options={})
  options[:attachment].name.to_s.underscore.pluralize
end