class String

Public Instance Methods

Blue() click to toggle source
# File lib/branch_cli/string.rb, line 30
def Blue
  "[blue]#{self}[/]"
end
Bold() click to toggle source
# File lib/branch_cli/string.rb, line 18
def Bold
  "[bold]#{self}[/]"
end
Green() click to toggle source
# File lib/branch_cli/string.rb, line 26
def Green
  "[green]#{self}[/]"
end
Red() click to toggle source
# File lib/branch_cli/string.rb, line 34
def Red
  "[red]#{self}[/]"
end
Yellow() click to toggle source
# File lib/branch_cli/string.rb, line 38
def Yellow
  "[yellow]#{self}[/]"
end
clearQuotes() click to toggle source
# File lib/branch_cli/string.rb, line 10
def clearQuotes
  gsub("\"", with: "")
end
components(separatedBy: ",") click to toggle source
# File lib/branch_cli/swift_compatibility.rb, line 67
def components(separatedBy: ",")
  split(separatedBy)
end
contains(*args) click to toggle source
# File lib/branch_cli/swift_compatibility.rb, line 59
def contains(*args)
  include?(*args)
end
f() click to toggle source
# File lib/branch_cli/string.rb, line 22
def f
  self
end
hasPrefix(str) click to toggle source
# File lib/branch_cli/swift_compatibility.rb, line 63
def hasPrefix(str)
  start_with?(str)
end
matches(forRegex: nil) click to toggle source
# File lib/branch_cli/string.rb, line 2
def matches(forRegex: nil)
  lines = split("\n")
  lines.map do |l|
    match = l.match(forRegex)
    match && match.captures
  end.flatten.compact
end
s() click to toggle source
# File lib/branch_cli/string.rb, line 14
def s
  self
end