Class: Proscenium::CssModule

Inherits:
Object
  • Object
show all
Defined in:
lib/proscenium/css_module.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CssModule

Returns a new instance of CssModule.



4
5
6
7
8
9
10
# File 'lib/proscenium/css_module.rb', line 4

def initialize(path)
  @path = "#{path}.module.css"

  return unless Rails.application.config.proscenium.side_load

  Proscenium::SideLoad.append! Rails.root.join(@path)
end

Instance Method Details

#class_names(*names) ⇒ Object

Returns an Array of class names generated from the given CSS module `names`.



13
14
15
# File 'lib/proscenium/css_module.rb', line 13

def class_names(*names)
  names.flatten.compact.map { |name| "#{name}#{hash}" }
end