Class: Zaptec::Circuit

Inherits:
Object
  • Object
show all
Defined in:
lib/zaptec/circuit.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Circuit



3
4
5
# File 'lib/zaptec/circuit.rb', line 3

def initialize(data)
  @data = data.symbolize_keys
end

Instance Method Details

#chargersObject



10
11
12
# File 'lib/zaptec/circuit.rb', line 10

def chargers
  @chargers ||= @data.fetch(:Chargers).map { |data| Charger.new(data) }
end

#idObject



7
# File 'lib/zaptec/circuit.rb', line 7

def id = @data.fetch(:Id)

#max_currentObject



8
# File 'lib/zaptec/circuit.rb', line 8

def max_current = @data.fetch(:MaxCurrent)