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