Class: Sass::Selector::Attribute
- Inherits:
- Simple
- Object
- Simple
- Sass::Selector::Attribute
- Defined in:
- /Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb
Overview
An attribute selector (e.g. [href^="http://"]
).
Instance Attribute Summary (collapse)
- - (String) flags readonly
Flags for the attribute selector (e.g.
i
). - - (Array<String, Sass::Script::Tree::Node>) name readonly
The attribute name.
- - (String?) namespace readonly
The attribute namespace.
- - (String) operator readonly
The matching operator, e.g.
- - (String) value readonly
The right-hand side of the operator.
Attributes inherited from Simple
Instance Method Summary (collapse)
- - (Attribute) initialize(name, namespace, operator, value, flags) constructor
A new instance of Attribute.
- - specificity
- - to_s(opts = {})
Methods inherited from Simple
#eql?, #equality_key, #hash, #inspect, #unify, #unify_namespaces
Constructor Details
- (Attribute) initialize(name, namespace, operator, value, flags)
Returns a new instance of Attribute
299 300 301 302 303 304 305 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 299
def initialize(name, namespace, operator, value, flags)
@name = name
@namespace = namespace
@operator = operator
@value = value
@flags = flags
end |
Instance Attribute Details
- (String) flags (readonly)
Flags for the attribute selector (e.g. i
).
292 293 294 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 292
def flags
@flags
end |
- (Array<String, Sass::Script::Tree::Node>) name (readonly)
The attribute name.
271 272 273 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 271
def name
@name
end |
- (String?) namespace (readonly)
The attribute namespace. nil
means the default namespace, ""
means no namespace, "*"
means any namespace.
277 278 279 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 277
def namespace
@namespace
end |
- (String) operator (readonly)
The matching operator, e.g. "="
or "^="
.
282 283 284 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 282
def operator
@operator
end |
- (String) value (readonly)
The right-hand side of the operator.
287 288 289 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 287
def value
@value
end |
Instance Method Details
- specificity
318 319 320 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 318
def specificity
SPECIFICITY_BASE
end |
- to_s(opts = {})
308 309 310 311 312 313 314 315 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/selector.rb', line 308
def to_s(opts = {})
res = "["
res << @namespace << "|" if @namespace
res << @name
res << @operator << @value if @value
res << " " << @flags if @flags
res << "]"
end |