Class: EthernetConnection
- Inherits:
-
Object
- Object
- EthernetConnection
- Defined in:
- lib/ethernet_connection.rb
Instance Attribute Summary collapse
-
#connectiontimeout ⇒ Object
readonly
Returns the value of attribute connectiontimeout.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#portname ⇒ Object
readonly
Returns the value of attribute portname.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(args) ⇒ EthernetConnection
constructor
A new instance of EthernetConnection.
- #port_config_string ⇒ Object
Constructor Details
#initialize(args) ⇒ EthernetConnection
Returns a new instance of EthernetConnection.
3 4 5 6 7 8 9 |
# File 'lib/ethernet_connection.rb', line 3 def initialize(args) @portname = 'TCP/IP' @host = args[:host] @port = args[:port] || default_port @connectiontimeout = args[:connectiontimeout] || default_connectiontimeout @timeout = args[:timeout] || default_timeout end |
Instance Attribute Details
#connectiontimeout ⇒ Object (readonly)
Returns the value of attribute connectiontimeout.
2 3 4 |
# File 'lib/ethernet_connection.rb', line 2 def connectiontimeout @connectiontimeout end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
2 3 4 |
# File 'lib/ethernet_connection.rb', line 2 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
2 3 4 |
# File 'lib/ethernet_connection.rb', line 2 def port @port end |
#portname ⇒ Object (readonly)
Returns the value of attribute portname.
2 3 4 |
# File 'lib/ethernet_connection.rb', line 2 def portname @portname end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
2 3 4 |
# File 'lib/ethernet_connection.rb', line 2 def timeout @timeout end |
Instance Method Details
#port_config_string ⇒ Object
11 12 13 |
# File 'lib/ethernet_connection.rb', line 11 def port_config_string "PortName=#{portname};Host=#{host};Port=#{port};ConnectionTimeout=#{connectiontimeout};Timeout=timeout" end |