Module: Denko::Behaviors::BusControllerAddressed
- Includes:
- BusController
- Included in:
- I2C::BusCommon, OneWire::Bus
- Defined in:
- lib/denko/behaviors/bus_controller_addressed.rb
Constant Summary
Constants included from Lifecycle
Instance Attribute Summary
Attributes included from Component
Attributes included from State
Instance Method Summary collapse
Methods included from BusController
Methods included from Subcomponents
#add_hw_i2c, #add_hw_spi, #add_single_pin, #components, #hw_i2c_comps, #hw_spi_comps, #remove_component, #remove_hw_i2c, #remove_hw_spi, #remove_single_pin, #single_pin_components
Methods included from Component
Methods included from State
Methods included from Lifecycle
Instance Method Details
#add_component(component) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/denko/behaviors/bus_controller_addressed.rb', line 6 def add_component(component) addresses = components.map { |c| c.address } if addresses.include? component.address raise ArgumentError, "duplicate peripheral address for #{component}" end super(component) end |