Class: MiniAutobot::Connector::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_autobot/connector.rb

Overview

Simple configuration container for all profiles. Struct is not used here because it contaminates the class with Enumerable methods, which will cause #method_missing in Connector to get confused.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connector, env) ⇒ Config

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a new configuration object. This object should never be instantiated directly.



32
33
34
35
# File 'lib/mini_autobot/connector.rb', line 32

def initialize(connector, env)
  @connector = connector
  @env = env
end

Instance Attribute Details

#connectorObject

Returns the value of attribute connector.



15
16
17
# File 'lib/mini_autobot/connector.rb', line 15

def connector
  @connector
end

#envObject

Returns the value of attribute env.



15
16
17
# File 'lib/mini_autobot/connector.rb', line 15

def env
  @env
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



17
18
19
# File 'lib/mini_autobot/connector.rb', line 17

def ==(other)
  self.class == other.class && self.connector == other.connector && self.env == other.env
end

#hashObject

Hashing mechanism should only look at the connector and environment values



24
25
26
# File 'lib/mini_autobot/connector.rb', line 24

def hash
  @connector.hash ^ @env.hash
end