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

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 class name including its namespace.

Instance Method Summary collapse

Instance Method Details

#labelObject

Portion of Pattern#string that will be replaced.



77
78
79
# File 'lib/adrift/pattern.rb', line 77

def label
  ':class'
end

#specialize(options = {}) ⇒ Object

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



83
84
85
# File 'lib/adrift/pattern.rb', line 83

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