Module: Playbook::Height
- Included in:
- KitBase
- Defined in:
- lib/playbook/height.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/playbook/height.rb', line 5 def self.included(base) base.prop :height end |
Instance Method Details
#height_options ⇒ Object
19 20 21 22 23 |
# File 'lib/playbook/height.rb', line 19 def { height: "height", } end |
#height_props ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/playbook/height.rb', line 9 def height_props selected_props = .keys.select { |sk| try(sk) } return nil unless selected_props.present? selected_props.map do |k| height_value = send(k) "height_#{height_value}" if height_values.include? height_value.to_s end.compact.join(" ") end |
#height_values ⇒ Object
25 26 27 |
# File 'lib/playbook/height.rb', line 25 def height_values %w[auto xs sm md lg xl xxl xxxl] end |