Class: Deadfire::FrontEnd::SelectorNode

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/deadfire/front_end/selector_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens) ⇒ SelectorNode

Returns a new instance of SelectorNode.



8
9
10
11
# File 'lib/deadfire/front_end/selector_node.rb', line 8

def initialize(tokens)
  @selector = tokens_to_selector(tokens)
  @mixin_name = fetch_mixin_name_from(tokens)
end

Instance Attribute Details

#mixin_nameObject (readonly)

Returns the value of attribute mixin_name.



6
7
8
# File 'lib/deadfire/front_end/selector_node.rb', line 6

def mixin_name
  @mixin_name
end

#selectorObject (readonly)

Returns the value of attribute selector.



6
7
8
# File 'lib/deadfire/front_end/selector_node.rb', line 6

def selector
  @selector
end

Instance Method Details

#accept(visitor) ⇒ Object



13
14
15
# File 'lib/deadfire/front_end/selector_node.rb', line 13

def accept(visitor)
  visitor.visit_selector_node(self)
end

#cacheable?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/deadfire/front_end/selector_node.rb', line 17

def cacheable?
  selector.start_with?(".")
end