Class: NRB::BCSInterrogator::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/bcs_interrogator/entity.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Entity

Returns a new instance of Entity.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bcs_interrogator/entity.rb', line 5

def initialize(args={})
  @bcs = args[:bcs]
  raise ArgumentError("Please provide a BCS object") if @bcs.nil?
  if args[:positions].is_a?(Fixnum)
    @positions = { output_names: args[:positions],
                   outputs: args[:positions],
                   temp_probe_names: args[:positions],
                   temps: args[:positions],
                   setpoints: args[:positions]
                 }
  else
    @positions = args[:positions]
  end
end

Instance Method Details

#input_nameObject



21
# File 'lib/bcs_interrogator/entity.rb', line 21

def input_name; data :input_names; end

#last_updateObject



22
# File 'lib/bcs_interrogator/entity.rb', line 22

def last_update; @bcs.last_update; end

#nameObject



23
# File 'lib/bcs_interrogator/entity.rb', line 23

def name; data :temp_probe_names; end

#outputObject



25
# File 'lib/bcs_interrogator/entity.rb', line 25

def output; data :outputs; end

#output_nameObject



24
# File 'lib/bcs_interrogator/entity.rb', line 24

def output_name; data :output_names; end

#setpointObject



26
# File 'lib/bcs_interrogator/entity.rb', line 26

def setpoint; data :setpoints; end

#tempObject



27
# File 'lib/bcs_interrogator/entity.rb', line 27

def temp; data :temps; end

#updateObject



28
# File 'lib/bcs_interrogator/entity.rb', line 28

def update; @bcs.update; end