Class: Stylegen::LightDarkColor
- Inherits:
-
Object
- Object
- Stylegen::LightDarkColor
- Defined in:
- lib/stylegen/colors/light_dark_color.rb
Instance Method Summary collapse
-
#initialize(light, dark) ⇒ LightDarkColor
constructor
A new instance of LightDarkColor.
- #to_s(struct_name, indent = 0) ⇒ Object
Constructor Details
#initialize(light, dark) ⇒ LightDarkColor
Returns a new instance of LightDarkColor.
5 6 7 8 |
# File 'lib/stylegen/colors/light_dark_color.rb', line 5 def initialize(light, dark) @light = light @dark = dark end |
Instance Method Details
#to_s(struct_name, indent = 0) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/stylegen/colors/light_dark_color.rb', line 10 def to_s(struct_name, indent = 0) indent_prefix = ' ' * indent result = [] result << "#{struct_name}(" result << "#{indent_prefix} light: #{@light.to_s(struct_name, indent + 4)}," result << "#{indent_prefix} dark: #{@dark.to_s(struct_name, indent + 4)}" result << "#{indent_prefix})" result.join("\n") end |