Sha256: afde3837b0362ffe00fa83772980f29c58e49a058ca3ad8ca0c39728032e46f6
Contents?: true
Size: 941 Bytes
Versions: 898
Compression:
Stored size: 941 Bytes
Contents
# frozen_string_literal: true module Playbook module FlexWrap def self.included(base) base.prop :flex_wrap end # rubocop:disable Style/IfInsideElse def flex_wrap_props selected_props = flex_wrap_options.keys.select { |sk| try(sk) } return nil unless selected_props.present? selected_props.map do |k| flex_wrap_value = send(k) if flex_wrap_value.is_a?(Hash) flex_wrap_value.map do |media_size, wrap_value| "flex_wrap_#{media_size}_#{wrap_value.underscore}" if flex_wrap_values.include? wrap_value end else "flex_wrap_#{flex_wrap_value}" if flex_wrap_values.include? flex_wrap_value end end.compact.join(" ") end # rubocop:enable Style/IfInsideElse def flex_wrap_options { flex_wrap: "flex_wrap", } end def flex_wrap_values %w[wrap nowrap wrapReverse] end end end
Version data entries
898 entries across 898 versions & 1 rubygems