Class: Rule
- Inherits:
-
Object
- Object
- Rule
- Defined in:
- lib/lights/rule.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(id = nil, data = {}) ⇒ Rule
constructor
A new instance of Rule.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id = nil, data = {}) ⇒ Rule
Returns a new instance of Rule.
4 5 6 7 8 |
# File 'lib/lights/rule.rb', line 4 def initialize( id = nil, data = {} ) @id = id @data = data @name = data["name"] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/lights/rule.rb', line 3 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/lights/rule.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/lights/rule.rb', line 3 def name @name end |
Instance Method Details
#to_json(options = {}) ⇒ Object
16 17 18 |
# File 'lib/lights/rule.rb', line 16 def to_json(={}) data.to_json end |