Class: Uniword::Drawingml::ColorScheme::ColorSchemeHash
- Inherits:
-
Object
- Object
- Uniword::Drawingml::ColorScheme::ColorSchemeHash
- Defined in:
- lib/uniword/drawingml/color_scheme.rb
Overview
Hash-like proxy that delegates writes to the ColorScheme
This allows both scheme[:accent1] = '0066CC' and scheme.colors[:accent1] = '0066CC'
to work correctly
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(color_scheme) ⇒ ColorSchemeHash
constructor
A new instance of ColorSchemeHash.
- #to_h ⇒ Object
Constructor Details
#initialize(color_scheme) ⇒ ColorSchemeHash
Returns a new instance of ColorSchemeHash.
220 221 222 |
# File 'lib/uniword/drawingml/color_scheme.rb', line 220 def initialize(color_scheme) @color_scheme = color_scheme end |
Instance Method Details
#[](key) ⇒ Object
224 225 226 |
# File 'lib/uniword/drawingml/color_scheme.rb', line 224 def [](key) @color_scheme[key] end |
#[]=(key, value) ⇒ Object
228 229 230 |
# File 'lib/uniword/drawingml/color_scheme.rb', line 228 def []=(key, value) @color_scheme[key] = value end |
#to_h ⇒ Object
232 233 234 |
# File 'lib/uniword/drawingml/color_scheme.rb', line 232 def to_h @color_scheme.all_colors end |