Class: Wemux::Pair::Configuration
- Inherits:
-
Object
- Object
- Wemux::Pair::Configuration
- Defined in:
- lib/wemux/pair/configuration.rb
Constant Summary collapse
- PAIR_CONFIG =
'.pair.yml'
Instance Attribute Summary collapse
-
#pair_user ⇒ Object
readonly
Returns the value of attribute pair_user.
-
#pow_host ⇒ Object
readonly
Returns the value of attribute pow_host.
-
#ssh_host ⇒ Object
readonly
Returns the value of attribute ssh_host.
-
#ssh_user ⇒ Object
readonly
Returns the value of attribute ssh_user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config) ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 |
# File 'lib/wemux/pair/configuration.rb', line 16 def initialize(config) @ssh_host = config.fetch('ssh_host') @ssh_user = config.fetch('ssh_user') @pair_user = config.fetch('pair_user') @pow_host = config.fetch('pow_host') { nil } end |
Instance Attribute Details
#pair_user ⇒ Object (readonly)
Returns the value of attribute pair_user.
14 15 16 |
# File 'lib/wemux/pair/configuration.rb', line 14 def pair_user @pair_user end |
#pow_host ⇒ Object (readonly)
Returns the value of attribute pow_host.
14 15 16 |
# File 'lib/wemux/pair/configuration.rb', line 14 def pow_host @pow_host end |
#ssh_host ⇒ Object (readonly)
Returns the value of attribute ssh_host.
14 15 16 |
# File 'lib/wemux/pair/configuration.rb', line 14 def ssh_host @ssh_host end |
#ssh_user ⇒ Object (readonly)
Returns the value of attribute ssh_user.
14 15 16 |
# File 'lib/wemux/pair/configuration.rb', line 14 def ssh_user @ssh_user end |
Class Method Details
.load ⇒ Object
8 9 10 11 12 |
# File 'lib/wemux/pair/configuration.rb', line 8 def self.load new(YAML.load_file(PAIR_CONFIG)) rescue Errno::ENOENT raise "#{PAIR_CONFIG} configuration not found" end |