Class: SectionsRails::Config
- Inherits:
-
Object
- Object
- SectionsRails::Config
- Defined in:
- lib/sections_rails/config.rb
Instance Attribute Summary collapse
-
#css_extensions ⇒ Object
Returns the value of attribute css_extensions.
-
#js_extensions ⇒ Object
Returns the value of attribute js_extensions.
-
#partial_extensions ⇒ Object
Returns the value of attribute partial_extensions.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sections_rails/config.rb', line 20 def initialize = {} .reverse_merge!({ path: 'app/sections', js_extensions: %w(js js.coffee coffee), css_extensions: %w(css css.scss css.sass sass scss), partial_extensions: %w(html.erb html.haml html.slim) }) .each do |option, value| if self.respond_to? option send("#{option}=", value) else raise ArgumentError.new "Invalid option '#{option}' for #{self.class.name}" end end end |
Instance Attribute Details
#css_extensions ⇒ Object
Returns the value of attribute css_extensions.
18 19 20 |
# File 'lib/sections_rails/config.rb', line 18 def css_extensions @css_extensions end |
#js_extensions ⇒ Object
Returns the value of attribute js_extensions.
18 19 20 |
# File 'lib/sections_rails/config.rb', line 18 def js_extensions @js_extensions end |
#partial_extensions ⇒ Object
Returns the value of attribute partial_extensions.
18 19 20 |
# File 'lib/sections_rails/config.rb', line 18 def partial_extensions @partial_extensions end |
#path ⇒ Object
Returns the value of attribute path.
18 19 20 |
# File 'lib/sections_rails/config.rb', line 18 def path @path end |