Module: Playbook::MaxHeight

Included in:
KitBase
Defined in:
lib/playbook/max_height.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/playbook/max_height.rb', line 5

def self.included(base)
  base.prop :max_height
end

Instance Method Details

#max_height_optionsObject



19
20
21
22
23
# File 'lib/playbook/max_height.rb', line 19

def max_height_options
  {
    max_height: "max_height",
  }
end

#max_height_propsObject



9
10
11
12
13
14
15
16
17
# File 'lib/playbook/max_height.rb', line 9

def max_height_props
  selected_props = max_height_options.keys.select { |sk| try(sk) }
  return nil unless selected_props.present?

  selected_props.map do |k|
    max_height_value = send(k)
    "max_height_#{max_height_value}" if max_height_values.include? max_height_value.to_s
  end.compact.join(" ")
end

#max_height_valuesObject



25
26
27
# File 'lib/playbook/max_height.rb', line 25

def max_height_values
  %w[auto xs sm md lg xl xxl xxxl]
end