Class: Drydock::CliFlags

Inherits:
Object
  • Object
show all
Defined in:
lib/drydock/cli_flags.rb

Instance Method Summary collapse

Constructor Details

#initialize(flags = {}) ⇒ CliFlags

Returns a new instance of CliFlags.



5
6
7
# File 'lib/drydock/cli_flags.rb', line 5

def initialize(flags = {})
  @flags = flags
end

Instance Method Details

#to_sObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/drydock/cli_flags.rb', line 9

def to_s
  return '' if flags.nil? || flags.empty?

  buffer = StringIO.new
  flags.each_pair do |k, v|
    buffer << process_flag(k, v)
  end

  buffer.string
end