class Sass::Supports::Operator - sass-3.2.19 Documentation

# class Sass::Supports::Operator

An operator condition (e.g. `CONDITION1 and CONDITION2`).

### Attributes

left[RW]

The left-hand condition.

@return [Sass::Supports::Condition]

op[RW]

The operator (“and” or “or”).

@return [String]

right[RW]

The right-hand condition.

@return [Sass::Supports::Condition]

### Public Class Methods

new(left, right, op) click to toggle source

    # File lib/sass/supports.rb, line 49
    def initialize(left, right, op)
      @left = left
      @right = right
      @op = op
    end

### Public Instance Methods

deep_copy() click to toggle 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

options=(options) click to toggle source

    # File lib/sass/supports.rb, line 75
    def options=(options)
      @left.options = options
      @right.options = options
    end

perform(env) click to toggle source

    # File lib/sass/supports.rb, line 55
    def perform(env)
      @left.perform(env)
      @right.perform(env)
    end

to_css() click to toggle source

    # File lib/sass/supports.rb, line 60
    def to_css
      "#{left_parens @left.to_css} #{op} #{right_parens @right.to_css}"
    end

to_src(options) click to toggle source

    # File lib/sass/supports.rb, line 64
    def to_src(options)
      "#{left_parens @left.to_src(options)} #{op} #{right_parens @right.to_src(options)}"
    end

### Private Instance Methods

left_parens(str) click to toggle source

    # File lib/sass/supports.rb, line 82
    def left_parens(str)
      return "(#{str})" if @left.is_a?(Negation)
      return str
    end

right_parens(str) click to toggle source

    # File lib/sass/supports.rb, line 87
    def right_parens(str)
      return "(#{str})" if @right.is_a?(Negation) || @right.is_a?(Operator)
      return str
    end