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

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, without its namespace.

Instance Method Summary collapse

Instance Method Details

#labelObject

Portion of Pattern#string that will be replaced.



93
94
95
# File 'lib/adrift/pattern.rb', line 93

def label
  ':class_name'
end

#specialize(options = {}) ⇒ Object

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



99
100
101
# File 'lib/adrift/pattern.rb', line 99

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