Class: Hardware::Bin
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
Instance Method Summary collapse
- #configure ⇒ Object
- #fetch_all ⇒ Object
-
#initialize(sensor_collection) ⇒ Bin
constructor
A new instance of Bin.
- #receive(object) ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(sensor_collection) ⇒ Bin
Returns a new instance of Bin.
5 6 7 8 |
# File 'lib/hardware/bin.rb', line 5 def initialize(sensor_collection) super(sensor_collection, nil) @contents = [] end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
4 5 6 |
# File 'lib/hardware/bin.rb', line 4 def contents @contents end |
Instance Method Details
#configure ⇒ Object
22 23 24 25 |
# File 'lib/hardware/bin.rb', line 22 def configure create_sensor_for(:bin_entry) create_sensor_for(:bin_fetch_all) end |
#fetch_all ⇒ Object
16 17 18 19 20 |
# File 'lib/hardware/bin.rb', line 16 def fetch_all contents.clear changed fire(:bin_fetch_all) end |
#receive(object) ⇒ Object
10 11 12 13 14 |
# File 'lib/hardware/bin.rb', line 10 def receive(object) contents << object changed fire(:bin_entry) end |