Class: Adrift::Pattern::Tags::ClassName
- Inherits:
-
Object
- Object
- Adrift::Pattern::Tags::ClassName
- 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
-
#label ⇒ Object
Portion of Pattern#string that will be replaced.
-
#specialize(options = {}) ⇒ Object
Pluralized model’s class name no namespaced.
Instance Method Details
#label ⇒ Object
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(={}) [:attachment].model.class.name.demodulize.underscore.pluralize end |