module Coaster::CssHashString::StringToStyle
Public Instance Methods
Source
# File lib/coaster/core_ext/css_hash_string.rb, line 32 def to_css_hash(**defaults) defaults.with_indifferent_access.merge( self.split(';').map do |pair| k, v = pair.split(':') [k.strip, v.strip] end.to_h ) end
Source
# File lib/coaster/core_ext/css_hash_string.rb, line 27 def to_css_style(**defaults) return self unless defaults.present? to_css_hash(**defaults).to_css_style end