Class: DepsGrapher::Layer
- Inherits:
-
Object
- Object
- DepsGrapher::Layer
- Defined in:
- lib/deps_grapher/layer.rb,
lib/deps_grapher/layer/registry.rb
Defined Under Namespace
Modules: Registry
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#visible ⇒ Object
Returns the value of attribute visible.
Class Method Summary collapse
Instance Method Summary collapse
- #color(&block) ⇒ Object
-
#initialize(&block) ⇒ Layer
constructor
A new instance of Layer.
- #source(&block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Layer
Returns a new instance of Layer.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/deps_grapher/layer.rb', line 28 def initialize(&block) @visible = true DSL.new(self).instance_eval(&block) assert! return if default? source.files.each do |file| Registry.register file, self end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/deps_grapher/layer.rb', line 26 def name @name end |
#visible ⇒ Object
Returns the value of attribute visible.
26 27 28 |
# File 'lib/deps_grapher/layer.rb', line 26 def visible @visible end |
Class Method Details
.exist?(file_path) ⇒ Boolean
21 22 23 |
# File 'lib/deps_grapher/layer.rb', line 21 def exist?(file_path) Registry.exist? file_path end |
.fetch(file_path) ⇒ Object
9 10 11 |
# File 'lib/deps_grapher/layer.rb', line 9 def fetch(file_path) Registry.fetch file_path end |
Instance Method Details
#color(&block) ⇒ Object
46 47 48 49 |
# File 'lib/deps_grapher/layer.rb', line 46 def color(&block) @color_defined = true if block Visualizer::Color.new(name, &block) end |