Class: Sensor::Payload
- Inherits:
-
Object
- Object
- Sensor::Payload
- Defined in:
- lib/sensor/payload.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#time_range ⇒ Object
readonly
Returns the value of attribute time_range.
Instance Method Summary collapse
- #acquire ⇒ Object
- #distribute ⇒ Object
-
#initialize(time_range) ⇒ Payload
constructor
A new instance of Payload.
Constructor Details
#initialize(time_range) ⇒ Payload
Returns a new instance of Payload.
14 15 16 17 |
# File 'lib/sensor/payload.rb', line 14 def initialize(time_range) @time_range = time_range @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/sensor/payload.rb', line 10 def data @data end |
#time_range ⇒ Object (readonly)
Returns the value of attribute time_range.
10 11 12 |
# File 'lib/sensor/payload.rb', line 10 def time_range @time_range end |
Instance Method Details
#acquire ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/sensor/payload.rb', line 19 def acquire actuator_classes.each do |actuator| @data.merge!(actuator.new(@time_range).acquire) end @data end |
#distribute ⇒ Object
27 28 29 |
# File 'lib/sensor/payload.rb', line 27 def distribute Sensor::OutputDistribution::FlowDock.new(self).distribute end |