module Graph::Function::ReformatString

Public Instance Methods

camel_title(s) click to toggle source
# File lib/graph/function/reformat_string.rb, line 7
def camel_title(s)
  s.to_s.split('_').collect(&:capitalize).join
end
escape_underscores(s) click to toggle source
# File lib/graph/function/reformat_string.rb, line 4
def escape_underscores(s)
  s.to_s.gsub("_", "\\_")
end
extract_filename(s) click to toggle source
# File lib/graph/function/reformat_string.rb, line 10
def extract_filename(s)
  matches = /([^\/]+:\d+)\>$/.match(s)
  !matches.nil? ? matches[1] : s
end