Class: RuleList
- Inherits:
-
Object
- Object
- RuleList
- Defined in:
- lib/lights/rulelist.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ RuleList
constructor
A new instance of RuleList.
- #to_json(options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
5 6 7 |
# File 'lib/lights/rulelist.rb', line 5 def rules @rules end |
Instance Method Details
#data ⇒ Object
12 13 14 15 16 |
# File 'lib/lights/rulelist.rb', line 12 def data data = @data @rules.each {|b| data[b.id] = b.data} if @rules data end |
#to_json(options = {}) ⇒ Object
18 19 20 |
# File 'lib/lights/rulelist.rb', line 18 def to_json(={}) data.to_json end |