Class: TED::MTU
- Inherits:
-
Object
- Object
- TED::MTU
- Defined in:
- lib/ted/mtu.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#ecc ⇒ Object
readonly
The ECC this MTU belongs to.
-
#index ⇒ Object
readonly
The 0-based index of this MTU in the ECC.
-
#spyders ⇒ Object
readonly
An Array of Spyders connected to this MTU.
Instance Method Summary collapse
- #current ⇒ Object
- #history(interval: :seconds, offset: nil, limit: nil, date_range: nil, start_time: nil, end_time: nil) ⇒ Object
-
#initialize(ecc, index, description) ⇒ MTU
constructor
A new instance of MTU.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(ecc, index, description) ⇒ MTU
Returns a new instance of MTU.
14 15 16 |
# File 'lib/ted/mtu.rb', line 14 def initialize(ecc, index, description) @ecc, @index, @description, @spyders = ecc, index, description, [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/ted/mtu.rb', line 9 def description @description end |
#ecc ⇒ Object (readonly)
The ECC this MTU belongs to
4 5 6 |
# File 'lib/ted/mtu.rb', line 4 def ecc @ecc end |
#index ⇒ Object (readonly)
The 0-based index of this MTU in the ECC
7 8 9 |
# File 'lib/ted/mtu.rb', line 7 def index @index end |
#spyders ⇒ Object (readonly)
An Array of Spyders connected to this MTU
12 13 14 |
# File 'lib/ted/mtu.rb', line 12 def spyders @spyders end |
Instance Method Details
#current ⇒ Object
18 19 20 |
# File 'lib/ted/mtu.rb', line 18 def current ecc.current(self) end |
#history(interval: :seconds, offset: nil, limit: nil, date_range: nil, start_time: nil, end_time: nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/ted/mtu.rb', line 22 def history(interval: :seconds, offset: nil, limit: nil, date_range: nil, start_time: nil, end_time: nil) offset = ECC.send(:interpret_offsets, offset, limit) date_range = ECC.send(:interpret_dates, date_range, start_time, end_time) ecc.send(:history_by_source, self, interval, offset, date_range) end |
#inspect ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/ted/mtu.rb', line 29 def inspect "#<TED::MTU:#{index} #{description}>" end |