Class: AwsGraph::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-graph.rb

Instance Method Summary collapse

Instance Method Details

#format_range(ip_range) ⇒ Object



316
317
318
319
320
321
322
# File 'lib/aws-graph.rb', line 316

def format_range(ip_range)
  if ip_range.sub(/\A[0-9]+\.\./,'') == ip_range.sub(/\.\.[0-9]+\z/,'')
    return ip_range.sub(/\A[0-9]+\.\./,'')
  else
    return ip_range
  end
end

#label(text, secret) ⇒ Object



309
310
311
312
313
314
315
# File 'lib/aws-graph.rb', line 309

def label(text, secret)
  if secret
    return text.gsub(/[^\[\]]/,'*')
  else
    return text
  end
end