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

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#labelObject

Portion of Pattern#string that will be replaced.



61
62
63
# File 'lib/adrift/pattern.rb', line 61

def label
  ':url'
end

#specialize(options = {}) ⇒ Object

Attachment’s url. Expects options to include the Attachment (:attachment key), and the selected style (:style key). .



68
69
70
# File 'lib/adrift/pattern.rb', line 68

def specialize(options={})
  options[:attachment].url(options[:style]).to_s
end