Class: String
- Inherits:
-
Object
show all
- Defined in:
- lib/hoopla_salesforce/ext/string.rb
Instance Method Summary
collapse
Instance Method Details
#camelize(first_letter_in_uppercase = true) ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/hoopla_salesforce/ext/string.rb', line 7
def camelize(first_letter_in_uppercase = true)
if first_letter_in_uppercase
gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
else
first.downcase + camelize(lower_case_and_underscored_word)[1..-1]
end
end
|
#margin ⇒ Object
2
3
4
5
|
# File 'lib/hoopla_salesforce/ext/string.rb', line 2
def margin
spaces = match(/^\s*/)
gsub(/^#{spaces[0]}/, '')
end
|