Class: RailsBlocks::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_blocks/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
23
# File 'lib/rails_blocks/configuration.rb', line 16

def initialize
	@blocks_dir = 'app/blocks'
	@levels = []
	@template_engine = '.slim'
	@element_separator = '__'
	@modifier_separator = '--'
	@js_class = 'js-bem'
end

Instance Attribute Details

#blocks_dirObject

Returns the value of attribute blocks_dir.



3
4
5
# File 'lib/rails_blocks/configuration.rb', line 3

def blocks_dir
  @blocks_dir
end

#element_separatorObject

Returns the value of attribute element_separator.



6
7
8
# File 'lib/rails_blocks/configuration.rb', line 6

def element_separator
  @element_separator
end

#js_classObject

Returns the value of attribute js_class.



8
9
10
# File 'lib/rails_blocks/configuration.rb', line 8

def js_class
  @js_class
end

#levelsObject

Returns the value of attribute levels.



4
5
6
# File 'lib/rails_blocks/configuration.rb', line 4

def levels
  @levels
end

#modifier_separatorObject

Returns the value of attribute modifier_separator.



7
8
9
# File 'lib/rails_blocks/configuration.rb', line 7

def modifier_separator
  @modifier_separator
end

#template_engineObject

Returns the value of attribute template_engine.



5
6
7
# File 'lib/rails_blocks/configuration.rb', line 5

def template_engine
  @template_engine
end

Instance Method Details

#ns(name) {|ns_config| ... } ⇒ Object

Yields:

  • (ns_config)


10
11
12
13
14
# File 'lib/rails_blocks/configuration.rb', line 10

def ns(name)
	@ns ||= {}
	ns_config = @ns[name] ||= Configuration.new
	yield ns_config
end