Class: RSMP::SXL::Interface

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rsmp/sxl/interface.rb

Overview

Base interface for SXL-specific behavior on a proxy connection.

Direct Known Subclasses

SiteInterface, SupervisorInterface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy:, name:, version:) ⇒ Interface

Returns a new instance of Interface.



13
14
15
16
17
# File 'lib/rsmp/sxl/interface.rb', line 13

def initialize(proxy:, name:, version:)
  @proxy = proxy
  @name = name
  @version = version
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/rsmp/sxl/interface.rb', line 11

def name
  @name
end

#proxyObject (readonly)

Returns the value of attribute proxy.



11
12
13
# File 'lib/rsmp/sxl/interface.rb', line 11

def proxy
  @proxy
end

#versionObject (readonly)

Returns the value of attribute version.



11
12
13
# File 'lib/rsmp/sxl/interface.rb', line 11

def version
  @version
end

Instance Method Details

#componentsObject



23
24
25
# File 'lib/rsmp/sxl/interface.rb', line 23

def components
  proxy.respond_to?(:components) ? proxy.components : proxy.site.components
end

#core_versionObject



35
36
37
# File 'lib/rsmp/sxl/interface.rb', line 35

def core_version
  proxy.core_version
end

#mainObject



27
28
29
# File 'lib/rsmp/sxl/interface.rb', line 27

def main
  proxy.respond_to?(:main) ? proxy.main : proxy.site.main
end

#nodeObject



19
20
21
# File 'lib/rsmp/sxl/interface.rb', line 19

def node
  proxy.node
end

#sxl_versionObject



31
32
33
# File 'lib/rsmp/sxl/interface.rb', line 31

def sxl_version
  version
end

#use_soc?Boolean

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/rsmp/sxl/interface.rb', line 39

def use_soc?
  return false unless core_version

  RSMP::Proxy.version_meets_requirement?(core_version, '>=3.1.5')
end

#validate_message!(_message) ⇒ Object



45
# File 'lib/rsmp/sxl/interface.rb', line 45

def validate_message!(_message); end