Class: Wemux::Pair::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/wemux/pair/configuration.rb

Constant Summary collapse

PAIR_CONFIG =
'.pair.yml'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_userObject (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_hostObject (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_hostObject (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_userObject (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

.loadObject



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