Class: SectionsRails::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sections_rails/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 options = {}
  options.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) })

  options.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_extensionsObject

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_extensionsObject

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_extensionsObject

Returns the value of attribute partial_extensions.



18
19
20
# File 'lib/sections_rails/config.rb', line 18

def partial_extensions
  @partial_extensions
end

#pathObject

Returns the value of attribute path.



18
19
20
# File 'lib/sections_rails/config.rb', line 18

def path
  @path
end