Class: SymbolComponent
- Inherits:
-
Object
- Object
- SymbolComponent
- Defined in:
- lib/delve/component/symbol.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(parent, symbol, color = :white) ⇒ SymbolComponent
constructor
A new instance of SymbolComponent.
- #symbol ⇒ Object
- #update(symbol, color = :white) ⇒ Object
Constructor Details
#initialize(parent, symbol, color = :white) ⇒ SymbolComponent
Returns a new instance of SymbolComponent.
2 3 4 5 6 7 8 9 |
# File 'lib/delve/component/symbol.rb', line 2 def initialize(parent, symbol, color=:white) raise 'Cannot create symbol component when parent is nil' unless parent raise 'Cannot create symbol component when symbol is nil' unless symbol @parent = parent @symbol = symbol @color = color end |
Instance Method Details
#id ⇒ Object
11 12 13 |
# File 'lib/delve/component/symbol.rb', line 11 def id :symbol end |
#symbol ⇒ Object
20 21 22 |
# File 'lib/delve/component/symbol.rb', line 20 def symbol { :char => @symbol, :color => @color } end |
#update(symbol, color = :white) ⇒ Object
15 16 17 18 |
# File 'lib/delve/component/symbol.rb', line 15 def update(symbol, color=:white) @symbol = symbol @color = color end |