Class: DepsGrapher::Visualizer::Color
- Inherits:
-
Object
- Object
- DepsGrapher::Visualizer::Color
- Defined in:
- lib/deps_grapher/visualizer/color.rb,
lib/deps_grapher/visualizer/color/registry.rb
Defined Under Namespace
Modules: Registry
Instance Attribute Summary collapse
-
#arrow ⇒ Object
Returns the value of attribute arrow.
-
#background ⇒ Object
Returns the value of attribute background.
-
#border ⇒ Object
Returns the value of attribute border.
-
#font ⇒ Object
Returns the value of attribute font.
-
#layer_name ⇒ Object
Returns the value of attribute layer_name.
-
#settings ⇒ Object
Returns the value of attribute settings.
Class Method Summary collapse
Instance Method Summary collapse
- #highlight(background:, border:, font: "#fff") ⇒ Object
-
#initialize(layer_name, &block) ⇒ Color
constructor
A new instance of Color.
Constructor Details
#initialize(layer_name, &block) ⇒ Color
Returns a new instance of Color.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/deps_grapher/visualizer/color.rb', line 21 def initialize(layer_name, &block) DSL.new(self).instance_eval(&block) @layer_name = layer_name @font ||= "#fff" assert! @settings = { background: background, border: border, font: font, highlight: { background: background, border: border, font: font } } Registry.register layer_name, self end |
Instance Attribute Details
#arrow ⇒ Object
Returns the value of attribute arrow.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def arrow @arrow end |
#background ⇒ Object
Returns the value of attribute background.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def background @background end |
#border ⇒ Object
Returns the value of attribute border.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def border @border end |
#font ⇒ Object
Returns the value of attribute font.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def font @font end |
#layer_name ⇒ Object
Returns the value of attribute layer_name.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def layer_name @layer_name end |
#settings ⇒ Object
Returns the value of attribute settings.
19 20 21 |
# File 'lib/deps_grapher/visualizer/color.rb', line 19 def settings @settings end |
Class Method Details
Instance Method Details
#highlight(background:, border:, font: "#fff") ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/deps_grapher/visualizer/color.rb', line 43 def highlight(background:, border:, font: "#fff") @settings[:highlight] = { background: background, border: border, font: font } self end |