Method: Sibu::DynamicStyle#initialize
- Defined in:
- app/models/sibu/dynamic_style.rb
#initialize(site_id, force_styles = false) ⇒ DynamicStyle
Returns a new instance of DynamicStyle.
6 7 8 9 10 11 12 13 14 15 |
# File 'app/models/sibu/dynamic_style.rb', line 6 def initialize(site_id, force_styles = false) @site = Sibu::Site.find(site_id) @styles_changed = @site.style.nil? || force_styles || styles_changed?(@site.style_url) if @styles_changed @filename = "#{site_id}_#{Time.current.to_i}" @scss_file = File.new(scss_file_path, 'w') @body = ERB.new(File.read(template_file_path)).result(binding) @env = Rails.application.assets end end |