Module: Voom::Presenters::WebClient::Helpers::PaddingHelpers
- Defined in:
- lib/voom/presenters/web_client/helpers/padding_helpers.rb
Instance Method Summary collapse
- #_alignment_class_(align) ⇒ Object
- #_padding?(padding, nesting = 0) ⇒ Boolean
- #_padding_array_(padding, nesting = 0) ⇒ Object
- #_padding_classes_(padding, nesting = 0) ⇒ Object
Instance Method Details
#_alignment_class_(align) ⇒ Object
17 18 19 |
# File 'lib/voom/presenters/web_client/helpers/padding_helpers.rb', line 17 def _alignment_class_(align) "v-grid-column-align-#{align}" end |
#_padding?(padding, nesting = 0) ⇒ Boolean
9 10 11 |
# File 'lib/voom/presenters/web_client/helpers/padding_helpers.rb', line 9 def _padding?(padding, nesting=0) _padding_array_(padding, nesting) != %i(top0 right0 bottom0 left0).sort end |
#_padding_array_(padding, nesting = 0) ⇒ Object
4 5 6 7 |
# File 'lib/voom/presenters/web_client/helpers/padding_helpers.rb', line 4 def _padding_array_(padding, nesting=0) return (%i(top0 right0 bottom0 left0) - padding.map {|p| "#{p.to_s.gsub(%r(\d),'')}0".to_sym} + padding.map(&:to_sym)).sort if padding nesting > 1 ? %i(top3 right0 bottom3 left0).sort : [] end |
#_padding_classes_(padding, nesting = 0) ⇒ Object
13 14 15 |
# File 'lib/voom/presenters/web_client/helpers/padding_helpers.rb', line 13 def _padding_classes_(padding, nesting=0) "v-padding-#{_padding_array_(padding, nesting).join('-')}" end |