Class: TED::MTU

Inherits:
Object
  • Object
show all
Defined in:
lib/ted/mtu.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/ted/mtu.rb', line 9

def description
  @description
end

#eccObject (readonly)

The ECC this MTU belongs to



4
5
6
# File 'lib/ted/mtu.rb', line 4

def ecc
  @ecc
end

#indexObject (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

#spydersObject (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

#currentObject



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

#inspectObject

:nodoc:



29
30
31
# File 'lib/ted/mtu.rb', line 29

def inspect
  "#<TED::MTU:#{index} #{description}>"
end