class Sass::Supports::Operator
An operator condition (e.g. ‘CONDITION1 and CONDITION2`).
Attributes
The left-hand condition.
@return [Sass::Supports::Condition]
The operator (“and” or “or”).
@return [String]
The right-hand condition.
@return [Sass::Supports::Condition]
Public Class Methods
Source
# File lib/sass/supports.rb, line 49 def initialize(left, right, op) @left = left @right = right @op = op end
Public Instance Methods
Source
# File lib/sass/supports.rb, line 68 def deep_copy copy = dup copy.left = @left.deep_copy copy.right = @right.deep_copy copy end
Source
# File lib/sass/supports.rb, line 75 def options=(options) @left.options = options @right.options = options end
Source
# File lib/sass/supports.rb, line 55 def perform(env) @left.perform(env) @right.perform(env) end
Source
# File lib/sass/supports.rb, line 60 def to_css "#{parens @left, @left.to_css} #{op} #{parens @right, @right.to_css}" end
Source
# File lib/sass/supports.rb, line 64 def to_src(options) "#{parens @left, @left.to_src(options)} #{op} #{parens @right, @right.to_src(options)}" end
Private Instance Methods
Source
# File lib/sass/supports.rb, line 82 def parens(condition, str) if condition.is_a?(Negation) || (condition.is_a?(Operator) && condition.op != op) return "(#{str})" else return str end end