lib/comparison/presenter.rb
##
# Returns the I18n translation for `comparison.style`.
#
# Use these translations to specify inline CSS style rules to be used when
# formatting comparison data. For example:
#
#     en:
#       comparison:
#         style:
#           positive: 'color: #3c763d; background-color: #dff0d8;'
#           negative: 'color: #a94442; background-color: #f2dede;'
#           nochange: 'color: #777777;'
#
#     content_tag :span, cmp.difference, style: cmp.style
#     # => "<span style=\"color: #3c763d; background-color: #dff0d8;\">+10%</span>"
#
# In general, it's probably preferable to use `#dom_classes` in conjunction
# with CSS style rules defined separate CSS files, but this isn't always
# possible.
#
Returns the I18n translation for `comparison.style`.
Use these translations to specify inline CSS style rules to be used when
formatting comparison data. For example.





In general, it's probably preferable to use `#dom_classes` in conjunction
with CSS style rules defined separate CSS files, but this isn't always
possible.
Returns the I18n translation for ` comparison . style ` . Use these translations to specify inline CSS style rules to be used when formatting comparison data . For example . In general it ' s probably preferable to use ` #dom_classes ` in conjunction with CSS style rules defined separate CSS files but this isn ' t always possible .
def style
      if positive?
        t 'comparison.style.positive',
          default: [:'comparison.css.positive', '']
      elsif negative?
        t 'comparison.style.negative',
          default: [:'comparison.css.negative', '']
      else
        t 'comparison.style.nochange',
          default: [:'comparison.css.nochange', '']
      end
    end
def style if positive? t 'comparison.style.positive' , default : [ :' comparison.css.positive ' , '' ] elsif negative? t 'comparison.style.negative' , default : [ :' comparison.css.negative ' , '' ] else t 'comparison.style.nochange' , default : [ :' comparison.css.nochange ' , '' ] end end
Returns the I18n translation for `comparison.style`.
Returns the I18n translation for ` comparison . style ` .