Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-jmeter/idl.rb,
lib/ruby-jmeter/helpers/strip-heredoc.rb

Instance Method Summary collapse

Instance Method Details

#classifyObject


14
15
16
17
# File 'lib/ruby-jmeter/idl.rb', line 14

def classify
  return self if self !~ / / && self =~ /[A-Z]+.*/
  split(' ').map{|e| e.capitalize}.join.gsub /[\(\)-\/\.]/, ''
end

#strip_heredocObject


2
3
4
# File 'lib/ruby-jmeter/helpers/strip-heredoc.rb', line 2

def strip_heredoc
  gsub /^#{self[/\A\s*/]}/, ''
end

#underscoreObject


19
20
21
22
23
24
25
# File 'lib/ruby-jmeter/idl.rb', line 19

def underscore
  self.gsub(/::/, '/').
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  tr("-", "_").
  downcase
end