Module: EacRubyUtils::Envs::SshEnv::DashoOptions::InstanceMethods

Defined in:
lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb

Instance Method Summary collapse

Instance Method Details

#nodasho_optionsObject


42
43
44
# File 'lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb', line 42

def nodasho_options
  self.class.nodasho_options
end

#ssh_command_line_dasho_argsObject


26
27
28
29
30
31
32
# File 'lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb', line 26

def ssh_command_line_dasho_args
  r = []
  uri.query_values&.each do |k, v|
    r += ['-o', "#{k}=#{v}"] unless nodasho_options.include?(k)
  end
  r
end

#ssh_command_line_nodasho_argsObject


34
35
36
37
38
39
40
# File 'lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb', line 34

def ssh_command_line_nodasho_args
  nodasho_options.flat_map do |option_name|
    uri_query_value(option_name).if_present([]) do |option_value|
      send("ssh_command_line_#{option_name.underscore}_args", option_value)
    end
  end
end

#uri_query_value(name) ⇒ Object


46
47
48
# File 'lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb', line 46

def uri_query_value(name)
  uri.query_values.if_present { |v| v[name] }
end