Class: Doohickey::SassExtensions::Gradients::ColorStop
- Inherits:
-
Sass::Script::Literal
- Object
- Sass::Script::Literal
- Doohickey::SassExtensions::Gradients::ColorStop
- Defined in:
- lib/doohickey/sass_extensions/gradients.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#stop ⇒ Object
Returns the value of attribute stop.
Instance Method Summary collapse
-
#initialize(color, stop = nil) ⇒ ColorStop
constructor
A new instance of ColorStop.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(color, stop = nil) ⇒ ColorStop
Returns a new instance of ColorStop.
27 28 29 |
# File 'lib/doohickey/sass_extensions/gradients.rb', line 27 def initialize(color, stop = nil) self.color, self.stop = color, stop end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
26 27 28 |
# File 'lib/doohickey/sass_extensions/gradients.rb', line 26 def color @color end |
#stop ⇒ Object
Returns the value of attribute stop.
26 27 28 |
# File 'lib/doohickey/sass_extensions/gradients.rb', line 26 def stop @stop end |
Instance Method Details
#inspect ⇒ Object
30 31 32 |
# File 'lib/doohickey/sass_extensions/gradients.rb', line 30 def inspect to_s end |
#to_s ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/doohickey/sass_extensions/gradients.rb', line 33 def to_s s = color.inspect.dup if stop s << " " if stop.unitless? s << stop.times(Sass::Script::Number.new(100, ["%"])).inspect else s << stop.inspect end end s end |