Sha256: 1ca99cc6aa3f67091aee02ec2c226584dfd336fadd4de29e3dbf12a6a44815db

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

module Workarea
  module Storefront
    class GoogleProductFeedSkuViewModel < ApplicationViewModel
      def status
        model.active? ? 'in stock' : 'out of stock'
      end

      def color
        Array.wrap(model.fetch_detail('color')).first
      end

      def condition
        'new'
      end

      def size
        Array.wrap(model.fetch_detail('size')).first
      end

      def displayable?
        return false unless options[:inventory_sku].present?
        options[:inventory_sku].displayable?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-google_product_feed-3.1.4 app/view_models/workarea/storefront/google_product_feed_sku_view_model.rb
workarea-google_product_feed-3.1.3 app/view_models/workarea/storefront/google_product_feed_sku_view_model.rb