Class: ComponentLibrary::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



38
39
40
41
42
# File 'lib/component_library.rb', line 38

def initialize
  @root_path = "components"
  @root_directory = "component"
  @application_css = "application"
end

Instance Attribute Details

#application_cssObject

Returns the value of attribute application_css.



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

def application_css
  @application_css
end

#multiconfigureObject

Returns the value of attribute multiconfigure.



36
37
38
# File 'lib/component_library.rb', line 36

def multiconfigure
  @multiconfigure
end

#root_directoryObject

Returns the value of attribute root_directory.



33
34
35
# File 'lib/component_library.rb', line 33

def root_directory
  @root_directory
end

#root_pathObject

Returns the value of attribute root_path.



34
35
36
# File 'lib/component_library.rb', line 34

def root_path
  @root_path
end

Instance Method Details

#for(filter) ⇒ Object



49
50
51
52
# File 'lib/component_library.rb', line 49

def for(filter)
  return multiconfigure.select {|mc| mc[:root_path] == filter } if multiconfigure.present?
  [{ :root_path => @root_path, :root_directory => @root_directory, :application_css => @application_css }]
end

#root_pathsObject



44
45
46
47
# File 'lib/component_library.rb', line 44

def root_paths
  return multiconfigure.map{|mc| mc[:root_path]} if multiconfigure.present?
  [@root_path]
end