Sha256: 0fbbe73439e81a538d3e938e2517bc908cdf0d943eaf8bf88ace34838b2412fd

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module Workarea
  module Storefront
    module ContentBlocks
      class ProductGridCellViewModel < ContentBlockViewModel
        include GridContent

        def image
          @image ||= find_asset(data[:asset])
        end

        def block_styles
          styles = []
          styles << background
          styles.join(" ")
        end

        def background
          "background: #{model.data[:background_color]} url(#{image.url}) no-repeat;"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-product_grid_content-1.4.0 app/view_models/workarea/storefront/content_blocks/product_grid_cell_view_model.rb
workarea-product_grid_content-1.3.1 app/view_models/workarea/storefront/content_blocks/product_grid_cell_view_model.rb
workarea-product_grid_content-1.3.0 app/view_models/workarea/storefront/content_blocks/product_grid_cell_view_model.rb