Class: Stylish::Selectors
- Inherits:
-
Array
- Object
- Array
- Stylish::Selectors
- Includes:
- Formattable
- Defined in:
- lib/stylish/core.rb
Overview
Selectors objects are simply used to group Selector objects for more convenient storage and serialisation.
Instance Method Summary collapse
-
#join(symbols = {}, scope = "") ⇒ Object
The join method overrides the superclass’ method in order to always use a specific separator, and so that the scope that the selectors are being used in can be passed through when Rules etc.
-
#to_s(symbols = {}, scope = "") ⇒ Object
The to_s method alternative way of calling the join method.
Methods included from Formattable
Instance Method Details
#join(symbols = {}, scope = "") ⇒ Object
The join method overrides the superclass’ method in order to always use a specific separator, and so that the scope that the selectors are being used in can be passed through when Rules etc. are serialised.
237 238 239 240 241 |
# File 'lib/stylish/core.rb', line 237 def join(symbols = {}, scope = "") self.inject("") do |ss, s| (ss.empty? ? "" : ss + self.class.format) + s.to_s(symbols, scope) end end |
#to_s(symbols = {}, scope = "") ⇒ Object
The to_s method alternative way of calling the join method.
244 245 246 |
# File 'lib/stylish/core.rb', line 244 def to_s(symbols = {}, scope = "") self.join(symbols, scope) end |