Class: LightningcssRb::AST::Selectors::Base
- Inherits:
-
Object
- Object
- LightningcssRb::AST::Selectors::Base
show all
- Defined in:
- lib/lightningcss_rb/ast/selectors/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(node:) ⇒ Base
Returns a new instance of Base.
21
22
23
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 21
def initialize(node:)
@node = node
end
|
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
7
8
9
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 7
def node
@node
end
|
Class Method Details
.from_ast(node) ⇒ Object
17
18
19
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 17
def self.from_ast(node)
new(node: node)
end
|
.node_attr_reader(*names) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 9
def self.node_attr_reader(*names)
names.each do |name|
define_method name do
node[name]
end
end
end
|
Instance Method Details
#to_css ⇒ Object
25
26
27
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 25
def to_css
raise NotImplementedError, "#{self.class.name} must implement #{to_css}"
end
|
#to_s ⇒ Object
29
|
# File 'lib/lightningcss_rb/ast/selectors/base.rb', line 29
def to_s = to_css
|