Class: CssParserMaster::Selectors
- Inherits:
-
Object
- Object
- CssParserMaster::Selectors
- Includes:
- Enumerable
- Defined in:
- lib/css_parser_master/selectors.rb
Instance Attribute Summary collapse
-
#selectors ⇒ Object
readonly
Returns the value of attribute selectors.
Instance Method Summary collapse
- #<<(selector) ⇒ Object
- #all ⇒ Object
- #each ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(selectors = []) ⇒ Selectors
constructor
A new instance of Selectors.
Constructor Details
#initialize(selectors = []) ⇒ Selectors
Returns a new instance of Selectors.
23 24 25 |
# File 'lib/css_parser_master/selectors.rb', line 23 def initialize(selectors = []) @selectors = selectors end |
Instance Attribute Details
#selectors ⇒ Object (readonly)
Returns the value of attribute selectors.
5 6 7 |
# File 'lib/css_parser_master/selectors.rb', line 5 def selectors @selectors end |
Instance Method Details
#<<(selector) ⇒ Object
7 8 9 |
# File 'lib/css_parser_master/selectors.rb', line 7 def << selector selectors << selector end |
#all ⇒ Object
11 12 13 |
# File 'lib/css_parser_master/selectors.rb', line 11 def all map{|sel| sel.split(',') } end |
#each ⇒ Object
15 16 17 |
# File 'lib/css_parser_master/selectors.rb', line 15 def each selectors.each { |sel| yield sel } end |
#empty? ⇒ Boolean
19 20 21 |
# File 'lib/css_parser_master/selectors.rb', line 19 def empty? selectors.empty? end |