class Rule

Attributes

detail[R]
lights[R]
name[R]
on[R]

Public Class Methods

new(key, hashvalue) click to toggle source
Calls superclass method HueResource::new
# File lib/ha/rule.rb, line 5
def initialize(key, hashvalue)
  super(key, hashvalue)
  @detail = "#{hashvalue["conditions"].length} conds => #{hashvalue["actions"].length} acts"
  @state.merge! ({"on" => @hash_value["status"], "name" => @name, "detail" => @detail})
  gen_reskey("r")
end
owning(number, grouparray) click to toggle source
# File lib/ha/rule.rb, line 16
def self.owning(number, grouparray)
  grouparray.select { |group| group.lights.include? number}
end

Public Instance Methods

array(selectors) click to toggle source
# File lib/ha/rule.rb, line 12
def array(selectors)
  selectors.map { |key| @state[key] }
end