Module: Playbook::FlexDirection
- Included in:
- KitBase
- Defined in:
- lib/playbook/flex_direction.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/playbook/flex_direction.rb', line 5 def self.included(base) base.prop :flex_direction end |
Instance Method Details
#flex_direction_options ⇒ Object
25 26 27 28 29 |
# File 'lib/playbook/flex_direction.rb', line 25 def { flex_direction: "flex_direction", } end |
#flex_direction_props ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/playbook/flex_direction.rb', line 9 def flex_direction_props selected_props = .keys.select { |sk| try(sk) } return nil unless selected_props.present? selected_props.map do |k| flex_direction_value = send(k) if flex_direction_value.is_a?(Hash) flex_direction_value.map do |media_size, flex_value| "flex_direction_#{media_size}_#{flex_value}" end else "flex_direction_#{flex_direction_value}" unless flex_direction_value.nil? end end.compact.join(" ") end |
#flex_direction_values ⇒ Object
31 32 33 |
# File 'lib/playbook/flex_direction.rb', line 31 def flex_direction_values %w[row column row_reverse column_reverse] end |