Method: OpenC3::InterfaceStatusModel#initialize

Defined in:
lib/openc3/models/interface_status_model.rb

#initialize(name:, state:, clients: 0, txsize: 0, rxsize: 0, txbytes: 0, rxbytes: 0, txcnt: 0, rxcnt: 0, updated_at: nil, plugin: nil, scope:) ⇒ InterfaceStatusModel

Returns a new instance of InterfaceStatusModel.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/openc3/models/interface_status_model.rb', line 75

def initialize(
  name:,
  state:,
  clients: 0,
  txsize: 0,
  rxsize: 0,
  txbytes: 0,
  rxbytes: 0,
  txcnt: 0,
  rxcnt: 0,
  updated_at: nil,
  plugin: nil,
  scope:
)
  if self.class._get_type == 'INTERFACESTATUS'
    super("#{scope}__#{INTERFACES_PRIMARY_KEY}", name: name, updated_at: updated_at, plugin: plugin, scope: scope)
  else
    super("#{scope}__#{ROUTERS_PRIMARY_KEY}", name: name, updated_at: updated_at, plugin: plugin, scope: scope)
  end
  @state = state
  @clients = clients
  @txsize = txsize
  @rxsize = rxsize
  @txbytes = txbytes
  @rxbytes = rxbytes
  @txcnt = txcnt
  @rxcnt = rxcnt
end