Class: CssColorContrast::CommandInterpreter::Value
- Inherits:
-
Object
- Object
- CssColorContrast::CommandInterpreter::Value
- Defined in:
- lib/css_color_contrast/command_interpreter.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(source, env, value = nil) ⇒ Value
constructor
A new instance of Value.
Constructor Details
#initialize(source, env, value = nil) ⇒ Value
Returns a new instance of Value.
23 24 25 26 27 |
# File 'lib/css_color_contrast/command_interpreter.rb', line 23 def initialize(source, env, value = nil) @source = source @env = env @value = value end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
17 18 19 |
# File 'lib/css_color_contrast/command_interpreter.rb', line 17 def source @source end |
Class Method Details
.assign(source, env, value = nil) ⇒ Object
19 20 21 |
# File 'lib/css_color_contrast/command_interpreter.rb', line 19 def self.assign(source, env, value = nil) new(source, env, value) end |
Instance Method Details
#evaluate ⇒ Object
29 30 31 32 33 |
# File 'lib/css_color_contrast/command_interpreter.rb', line 29 def evaluate return @env[@source] if @source.start_with?('@') @value || @source end |