Class: Sass::Tree::IfNode

Inherits:
Node show all
Defined in:
lib/sass/tree/if_node.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #filename, #line, #options

Instance Method Summary collapse

Methods inherited from Node

#<<, #==, #invisible?, #last, #perform, #render, #style, #to_s, #to_sass

Constructor Details

#initialize(expr) ⇒ IfNode

Returns a new instance of IfNode.



7
8
9
10
11
# File 'lib/sass/tree/if_node.rb', line 7

def initialize(expr)
  @expr = expr
  @last_else = self
  super()
end

Instance Attribute Details

#elseObject

Returns the value of attribute else.



5
6
7
# File 'lib/sass/tree/if_node.rb', line 5

def else
  @else
end

Instance Method Details

#add_else(node) ⇒ Object



13
14
15
16
# File 'lib/sass/tree/if_node.rb', line 13

def add_else(node)
  @last_else.else = node
  @last_else = node
end

#options=(options) ⇒ Object



18
19
20
21
# File 'lib/sass/tree/if_node.rb', line 18

def options=(options)
  super
  self.else.options = options if self.else
end