class Fuse::Document::Asset::StyleSheet::Conditional
Constants
- CONDITIONAL_PATTERN
Attributes
comparison[R]
version[R]
Public Class Methods
new(style_sheet)
click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 59 def initialize(style_sheet) match = CONDITIONAL_PATTERN.match(style_sheet.path) return unless match @comparison = (match[1] || '').strip.downcase @version = match[2].strip.to_i unless match[2].nil? end
Public Instance Methods
signature()
click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 76 def signature @signature ||= begin ret = (comparison.nil? || comparison.empty?) ? 'IE' : comparison + ' IE' ret << ' ' + version.to_s if version end end
wrap(content)
click to toggle source
# File lib/fuse/document/asset/style_sheet.rb, line 66 def wrap(content) if comparison == '!' "<!--[if !IE]> -->#{content}<!-- <![endif]-->" elsif comparison "<!--[if #{signature}]>#{content}<![endif]-->" else content end end