Class: CBS::Binding
- Inherits:
-
Object
- Object
- CBS::Binding
- Defined in:
- lib/cbs.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#selectors ⇒ Object
Returns the value of attribute selectors.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(selectors, code) ⇒ Binding
constructor
A new instance of Binding.
Constructor Details
#initialize(selectors, code) ⇒ Binding
Returns a new instance of Binding.
228 229 230 |
# File 'lib/cbs.rb', line 228 def initialize(selectors, code) @selectors, @code = selectors, code end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
227 228 229 |
# File 'lib/cbs.rb', line 227 def code @code end |
#selectors ⇒ Object
Returns the value of attribute selectors.
227 228 229 |
# File 'lib/cbs.rb', line 227 def selectors @selectors end |
Instance Method Details
#format ⇒ Object
231 232 233 234 235 236 237 |
# File 'lib/cbs.rb', line 231 def format @selectors.inject('') do |code, selector| code << format_with(selector) code << ",\n" unless @selectors.last === selector code end end |