Skip to content

Commit

Permalink
fixed minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cielavenir committed Feb 8, 2014
1 parent c2a0cad commit 289a285
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/core/facets/string.rb
Expand Up @@ -45,6 +45,7 @@
require_relative 'string/remove.rb'
require_relative 'string/rewrite.rb'
#require_relative 'integer/roman.rb' # uncommon
require_relative 'string/rotate.rb'
require_relative 'string/shatter.rb'
require_relative 'string/similarity.rb'
require_relative 'string/snakecase.rb'
Expand Down
4 changes: 1 addition & 3 deletions lib/core/facets/string/rotate.rb
Expand Up @@ -7,7 +7,6 @@ class String
# 'abcdefgh'.rotate(-2) #=> 'ghabcdef'
#
# CREDIT: T. Yamada

def rotate(count=1)
count+=self.length if count<0
self.slice(count,self.length-count)+self.slice(0,count)
Expand All @@ -20,7 +19,6 @@ def rotate(count=1)
# s.should eq 'cdefghab'
#
# CREDIT: T. Yamada

def rotate!(count=1) self.replace(self.rotate(count)) end
def rotate!(count=1) replace(rotate(count)) end

end

0 comments on commit 289a285

Please sign in to comment.