Class: TED::Spyder::Group

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, description, cts) ⇒ Group

Returns a new instance of Group.



12
13
14
# File 'lib/ted/spyder/group.rb', line 12

def initialize(index, description, cts)
  @index, @description, @cts = index, description, cts
end

Instance Attribute Details

#ctsObject (readonly)

An Array of CTs that compose this Group



10
11
12
# File 'lib/ted/spyder/group.rb', line 10

def cts
  @cts
end

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/ted/spyder/group.rb', line 8

def description
  @description
end

#indexObject (readonly)

The one-based index of this Group in the entire ECC



7
8
9
# File 'lib/ted/spyder/group.rb', line 7

def index
  @index
end

#spyderObject (readonly)

The Spyder this Group belongs to



5
6
7
# File 'lib/ted/spyder/group.rb', line 5

def spyder
  @spyder
end

Instance Method Details

#currentObject

Current data for this Group



17
18
19
# File 'lib/ted/spyder/group.rb', line 17

def current
  spyder.mtu.ecc.current(:spyders)[self]
end

#history(interval: :minutes, offset: nil, limit: nil, date_range: nil, start_time: nil, end_time: nil) ⇒ Object



21
22
23
24
25
# File 'lib/ted/spyder/group.rb', line 21

def history(interval: :minutes, 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)
  spyder.mtu.ecc.send(:history_by_source, self, interval, offset, date_range)
end

#inspectObject

:nodoc:



28
29
30
# File 'lib/ted/spyder/group.rb', line 28

def inspect
  "#<TED::Spyder::Group:#{index} #{description} cts=#{cts.inspect}>"
end