Class: CSSPool::CSS::MediaQueryList
- Defined in:
- lib/csspool/css/media_query_list.rb
Instance Attribute Summary collapse
-
#media_queries ⇒ Object
Returns the value of attribute media_queries.
-
#parse_location ⇒ Object
Returns the value of attribute parse_location.
-
#rule_sets ⇒ Object
Returns the value of attribute rule_sets.
Attributes inherited from Node
#inner_end_pos, #inner_start_pos, #outer_end_pos, #outer_start_pos
Instance Method Summary collapse
- #<<(media_query) ⇒ Object (also: #push)
- #[](idx) ⇒ Object
- #first ⇒ Object
-
#initialize(media_queries = [], parse_location = {}) ⇒ MediaQueryList
constructor
A new instance of MediaQueryList.
- #inspect ⇒ Object
- #last ⇒ Object
- #length ⇒ Object (also: #size)
Methods inherited from Node
#==, #accept, #children, #each, #hash, #to_css, #to_minified_css
Constructor Details
#initialize(media_queries = [], parse_location = {}) ⇒ MediaQueryList
Returns a new instance of MediaQueryList.
6 7 8 9 10 |
# File 'lib/csspool/css/media_query_list.rb', line 6 def initialize(media_queries = [], parse_location = {}) @media_queries = media_queries @parse_location = parse_location @rule_sets = [] end |
Instance Attribute Details
#media_queries ⇒ Object
Returns the value of attribute media_queries.
4 5 6 |
# File 'lib/csspool/css/media_query_list.rb', line 4 def media_queries @media_queries end |
#parse_location ⇒ Object
Returns the value of attribute parse_location.
4 5 6 |
# File 'lib/csspool/css/media_query_list.rb', line 4 def parse_location @parse_location end |
#rule_sets ⇒ Object
Returns the value of attribute rule_sets.
4 5 6 |
# File 'lib/csspool/css/media_query_list.rb', line 4 def rule_sets @rule_sets end |
Instance Method Details
#<<(media_query) ⇒ Object Also known as: push
12 13 14 15 |
# File 'lib/csspool/css/media_query_list.rb', line 12 def <<(media_query) media_queries << media_query self end |
#[](idx) ⇒ Object
31 32 33 |
# File 'lib/csspool/css/media_query_list.rb', line 31 def [](idx) media_queries[idx] end |
#first ⇒ Object
23 24 25 |
# File 'lib/csspool/css/media_query_list.rb', line 23 def first media_queries.first end |
#inspect ⇒ Object
35 36 37 |
# File 'lib/csspool/css/media_query_list.rb', line 35 def inspect media_queries.inspect end |
#last ⇒ Object
27 28 29 |
# File 'lib/csspool/css/media_query_list.rb', line 27 def last media_queries.last end |
#length ⇒ Object Also known as: size
18 19 20 |
# File 'lib/csspool/css/media_query_list.rb', line 18 def length media_queries.length end |