Class: Sass::Selector::Attribute
Overview
An attribute selector (e.g. [href^="http://"]).
Instance Attribute Summary
- - (Array<String, Sass::Script::Node>) name readonly The attribute name.
- - (Array<String, Sass::Script::Node>?) namespace readonly The attribute namespace.
- - (String) operator readonly The matching operator, e.g.
- - (Array<String, Sass::Script::Node>) value readonly The right-hand side of the operator.
Instance Method Summary
- - (Attribute) initialize(name, namespace, operator, value) constructor A new instance of Attribute.
- - to_a
Methods inherited from Simple
#eql?, #hash, #inspect, #unify, #unify_namespaces
Constructor Details
- (Attribute) initialize(name, namespace, operator, value)
A new instance of Attribute
263 264 265 266 267 268 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 263
def initialize(name, namespace, operator, value)
@name = name
@namespace = namespace
@operator = operator
@value = value
end
|
Instance Attribute Details
- (Array<String, Sass::Script::Node>) name (readonly)
The attribute name.
239 240 241 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 239
def name
@name
end
|
- (Array<String, Sass::Script::Node>?) namespace (readonly)
The attribute namespace. nil means the default namespace, [""] means no namespace, ["*"] means any namespace.
247 248 249 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 247
def namespace
@namespace
end
|
- (String) operator (readonly)
The matching operator, e.g. "=" or "^=".
252 253 254 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 252
def operator
@operator
end
|
- (Array<String, Sass::Script::Node>) value (readonly)
The right-hand side of the operator.
257 258 259 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 257
def value
@value
end
|
Instance Method Details
- to_a
271 272 273 274 275 276 277 |
# File '/var/www/sass-pages/.haml/lib/sass/selector.rb', line 271
def to_a
res = ["["]
res.concat(@namespace) << "|" if @namespace
res.concat @name
(res << @operator).concat @value if @value
res << "]"
end
|