Class: Sass::Selector::Attribute
- Inherits:
-
Simple
- Object
- Simple
- Sass::Selector::Attribute
- Defined in:
- .ruby-sass/lib/sass/selector.rb
Overview
An attribute selector (e.g. `[href^=“http://”]`).
Instance Attribute Summary (collapse)
-
#flags ⇒ String
readonly
Flags for the attribute selector (e.g. `i`).
-
#name ⇒ Array<String, Sass::Script::Tree::Node>
readonly
The attribute name.
-
#namespace ⇒ String?
readonly
The attribute namespace.
-
#operator ⇒ String
readonly
The matching operator, e.g.
-
#value ⇒ String
readonly
The right-hand side of the operator.
Attributes inherited from Simple
Instance Method Summary (collapse)
-
#initialize(name, namespace, operator, value, flags) ⇒ Attribute
constructor
A new instance of Attribute.
- #specificity ⇒ Object
- #to_s(opts = {}) ⇒ Object
Methods inherited from Simple
#eql?, #hash, #inspect, #unify, #unique?
Constructor Details
#initialize(name, namespace, operator, value, flags) ⇒ Attribute
Returns a new instance of Attribute
303 304 305 306 307 308 309 |
# File '.ruby-sass/lib/sass/selector.rb', line 303 def initialize(name, namespace, operator, value, flags) @name = name @namespace = namespace @operator = operator @value = value @flags = flags end |
Constructor Details
#initialize(name, namespace, operator, value, flags) ⇒ Attribute
Returns a new instance of Attribute
303 304 305 306 307 308 309 |
# File '.ruby-sass/lib/sass/selector.rb', line 303 def initialize(name, namespace, operator, value, flags) @name = name @namespace = namespace @operator = operator @value = value @flags = flags end |
Instance Attribute Details
#flags ⇒ String (readonly)
Flags for the attribute selector (e.g. `i`).
296 297 298 |
# File '.ruby-sass/lib/sass/selector.rb', line 296 def flags @flags end |
#name ⇒ Array<String, Sass::Script::Tree::Node> (readonly)
The attribute name.
275 276 277 |
# File '.ruby-sass/lib/sass/selector.rb', line 275 def name @name end |
#namespace ⇒ String? (readonly)
The attribute namespace. `nil` means the default namespace, `“”` means no namespace, `“*”` means any namespace.
281 282 283 |
# File '.ruby-sass/lib/sass/selector.rb', line 281 def namespace @namespace end |
#operator ⇒ String (readonly)
The matching operator, e.g. `“=”` or `“^=”`.
286 287 288 |
# File '.ruby-sass/lib/sass/selector.rb', line 286 def operator @operator end |
#value ⇒ String (readonly)
The right-hand side of the operator.
291 292 293 |
# File '.ruby-sass/lib/sass/selector.rb', line 291 def value @value end |
Instance Method Details
#specificity ⇒ Object
322 323 324 |
# File '.ruby-sass/lib/sass/selector.rb', line 322 def specificity SPECIFICITY_BASE end |
#to_s(opts = {}) ⇒ Object
312 313 314 315 316 317 318 319 |
# File '.ruby-sass/lib/sass/selector.rb', line 312 def to_s(opts = {}) res = "[" res << @namespace << "|" if @namespace res << @name res << @operator << @value if @value res << " " << @flags if @flags res << "]" end |