Class: ConnectionFactory
- Inherits:
-
Object
- Object
- ConnectionFactory
- Defined in:
- lib/connection_factory.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(args) ⇒ ConnectionFactory
constructor
A new instance of ConnectionFactory.
- #port_config_string ⇒ Object
Constructor Details
#initialize(args) ⇒ ConnectionFactory
Returns a new instance of ConnectionFactory.
7 8 9 10 11 12 13 14 |
# File 'lib/connection_factory.rb', line 7 def initialize(args) hash_with_indifferent_access(args) if args[:host].nil? @connection = ComConnection.new(args) else @connection = EthernetConnection.new(args) end end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/connection_factory.rb', line 5 def connection @connection end |
Instance Method Details
#port_config_string ⇒ Object
16 17 18 |
# File 'lib/connection_factory.rb', line 16 def port_config_string @connection.port_config_string end |