Class: Greenhouse::Scripts::Arguments

Inherits:
Array
  • Object
show all
Defined in:
lib/greenhouse/scripts/arguments.rb

Instance Method Summary collapse

Instance Method Details

#to_helpObject



15
16
17
18
19
# File 'lib/greenhouse/scripts/arguments.rb', line 15

def to_help
  map do |arg|
    "  #{"%-#{sort { |a,b| a.keys.join(", ").length <=> b.keys.join(", ").length }.last.keys.join(", ").length + 2}s" % arg.keys.join(", ")}# #{arg.summary}"
  end.join("\n")
end

#to_sObject



5
6
7
8
9
10
11
12
13
# File 'lib/greenhouse/scripts/arguments.rb', line 5

def to_s
  map do |arg|
    #if arg.valid.nil? || arg.valid.empty?
      "[#{arg.keys.join(", ")}]"
    #else
    #  "[#{arg.keys.join(", ")} = (#{arg.valid.join("|")})]"
    #end
  end.join(" ")
end