Class: Sass::Supports::Operator
- Defined in:
- lib/sass/supports.rb
Overview
An operator condition (e.g. CONDITION1 and CONDITION2
).
Instance Attribute Summary collapse
-
#left ⇒ Sass::Supports::Condition
The left-hand condition.
-
#op ⇒ String
The operator ("and" or "or").
-
#right ⇒ Sass::Supports::Condition
The right-hand condition.
Instance Method Summary collapse
- #deep_copy
-
#initialize(left, right, op) ⇒ Operator
constructor
A new instance of Operator.
- #options=(options)
- #perform(env)
- #to_css
- #to_src(options)
Constructor Details
#initialize(left, right, op) ⇒ Operator
Returns a new instance of Operator.
49 50 51 52 53 |
# File 'lib/sass/supports.rb', line 49
def initialize(left, right, op)
@left = left
@right = right
@op = op
end
|
Instance Attribute Details
#left ⇒ Sass::Supports::Condition
The left-hand condition.
37 38 39 |
# File 'lib/sass/supports.rb', line 37
def left
@left
end
|
#op ⇒ String
The operator ("and" or "or").
47 48 49 |
# File 'lib/sass/supports.rb', line 47
def op
@op
end
|
#right ⇒ Sass::Supports::Condition
The right-hand condition.
42 43 44 |
# File 'lib/sass/supports.rb', line 42
def right
@right
end
|
Instance Method Details
#deep_copy
68 69 70 71 72 73 |
# 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)
75 76 77 78 |
# File 'lib/sass/supports.rb', line 75
def options=(options)
@left.options = options
@right.options = options
end
|
#perform(env)
55 56 57 58 |
# File 'lib/sass/supports.rb', line 55
def perform(env)
@left.perform(env)
@right.perform(env)
end
|
#to_css
60 61 62 |
# File 'lib/sass/supports.rb', line 60
def to_css
"#{parens @left, @left.to_css} #{op} #{parens @right, @right.to_css}"
end
|
#to_src(options)
64 65 66 |
# 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
|