Class | Sip::CmdOpts |
In: |
lib/sip/cmdopts.rb
|
Parent: | Hash |
# File lib/sip/cmdopts.rb, line 9 def to_s(prefix=nil, suffix=nil) opts = map { |k,v| if v.nil? (k.length > 1) ? "--#{k}" : "-#{k}" else (k.length > 1) ? "--#{k}=#{v}" : "-#{k} #{v}" end }.join(" ") [(prefix.nil? ? "" : prefix), opts, (suffix.nil? ? "" : suffix)].select { |v| v != "" }.join(" ") end