Module: Preprocessor::Image
- Included in:
- BasicPreprocessor
- Defined in:
- lib/preprocessor/image.rb
Class Attribute Summary collapse
-
.options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Class Attribute Details
.options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/preprocessor/image.rb', line 4 def @options end |
Instance Method Details
#image(options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/preprocessor/image.rb', line 9 def image() attrs = { :src => absolutize([:src], ::Preprocessor::Image.[:default_path]), :alt => [:alt] || "", :title => [:title] == "alt" ? [:alt] : [:title] } = case [:caption] when "alt" attrs[:alt] when "title" attrs[:title] else [:caption] end = %{<span class="caption">#{}</span>} attr_str = attrs.map { |k, v| %{#{k}="#{v}"} }.join(' ') %{<p class="image"><img #{attr_str} />#{}</p>} end |