Class: Zaptec::Circuit
- Inherits:
-
Object
- Object
- Zaptec::Circuit
- Defined in:
- lib/zaptec/circuit.rb
Instance Method Summary collapse
- #chargers ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ Circuit
constructor
A new instance of Circuit.
- #max_current ⇒ Object
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
#chargers ⇒ Object
10 11 12 |
# File 'lib/zaptec/circuit.rb', line 10 def chargers @chargers ||= @data.fetch(:Chargers).map { |data| Charger.new(data) } end |
#id ⇒ Object
7 |
# File 'lib/zaptec/circuit.rb', line 7 def id = @data.fetch(:Id) |
#max_current ⇒ Object
8 |
# File 'lib/zaptec/circuit.rb', line 8 def max_current = @data.fetch(:MaxCurrent) |