Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/engine_of_war/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#uncomment(comment = "//") ⇒ Object



6
7
8
# File 'lib/engine_of_war/extensions/string.rb', line 6

def uncomment(comment = "//")
  gsub(%r{^#{comment}\s*}, '')
end

#unindentObject



2
3
4
# File 'lib/engine_of_war/extensions/string.rb', line 2

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