Class: Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/aml/Cluster.rb

Overview

Cluster will have access to all variable and mixin definitions.

Instance Method Summary collapse

Constructor Details

#initialize(files) ⇒ Cluster

Returns a new instance of Cluster.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/aml/Cluster.rb', line 4

def initialize(files)
	@log = []
	@definition = []
	@cluster = {
		:variables => {},
		:mixins => {}
	}
	files.each do |file|
		@definition << Definition.new(file[:file], file[:type], file[:bundle])
	end
end

Instance Method Details

#definitionObject



38
39
40
# File 'lib/aml/Cluster.rb', line 38

def definition
	@definition
end

#logObject



29
30
31
# File 'lib/aml/Cluster.rb', line 29

def log
	@log
end

#mixinsObject



35
36
37
# File 'lib/aml/Cluster.rb', line 35

def mixins
	@cluster[:mixins]
end

#post_processObject



24
25
26
27
28
# File 'lib/aml/Cluster.rb', line 24

def post_process
	definition.each do |definition|
		process_conditional(definition)
	end
end

#processObject



15
16
17
18
19
20
21
22
23
# File 'lib/aml/Cluster.rb', line 15

def process
	@definition.each do |definition|
		definition.log.each do |log|
			@log << log
		end
		process_variable_definition(definition)
		process_mixin_definition(definition)
	end
end

#variablesObject



32
33
34
# File 'lib/aml/Cluster.rb', line 32

def variables
	@cluster[:variables]
end