Sha256: f904e2c1b033870b7b50f132e270df7ac0420de9e6bba6c4e8291eab8077fc6a

Contents?: true

Size: 789 Bytes

Versions: 5

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

module CriticalCssGenerator
  class Config
    class << self
      attr_writer :width, :height, :keep_larger_media_queries,
                  :render_wait_time, :penthouse_options

      def width
        @width ||= 1200
      end

      def height
        @height ||= 900
      end

      def render_wait_time
        @render_wait_time ||= 2000
      end

      def keep_larger_media_queries
        @keep_larger_media_queries ||= false
      end

      def as_json_config(props = {})
        {
          width: width,
          height: height,
          keepLargerMediaQueries: keep_larger_media_queries,
          renderWaitTime: render_wait_time,
        }
          .merge!(@penthouse_options || {})
          .merge!(props)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_critical_css-0.3.1 lib/critical_css_generator/config.rb
rails_critical_css-0.3.0 lib/critical_css_generator/config.rb
rails_critical_css-0.2.0 lib/critical_css_generator/critical_css_generator/config.rb
rails_critical_css-0.1.1 lib/critical_css_generator/critical_css_generator/config.rb
rails_critical_css-0.1.0 lib/critical_css_generator/config.rb