decko-commons/decko

View on GitHub
mod/bar_and_box/set/abstract/media.rb

Summary

Maintainability
A
0 mins
Test Coverage
format :html do
  def image_card
    @image_card ||= card.fetch(:image, new: {})
  end

  def text_with_image opts={}
    class_up "media-left", "m-2"
    @image_card = Card.cardish(opts[:image]) if opts[:image]
    haml :media_snippet, normalized_text_with_image_opts(opts)
  end

  private

  def normalized_text_with_image_opts opts
    opts.reverse_merge! title: _render_title, text: "", size: voo.size, media_opts: {}
  end
end