Skip to content

Commit

Permalink
Misc refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed May 5, 2009
1 parent b90b199 commit 1335fef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rext/numeric/bytes.rb
@@ -1,8 +1,8 @@

class Numeric

def bytes; self end
def kilobytes; self * 1024 end
def bytes; self end
def kilobytes; self * 1024 end
def megabytes; self * 1024.kilobytes end
def gigabytes; self * 1024.megabytes end
def terabytes; self * 1024.gigabytes end
Expand Down
2 changes: 1 addition & 1 deletion lib/rext/object/helpers.rb
Expand Up @@ -19,7 +19,7 @@ def indifferent_hash
end

##
# Yeild and return +value+.
# Yield and return +value+.
#
# === Examples
#
Expand Down
4 changes: 2 additions & 2 deletions lib/rext/string/helpers.rb
Expand Up @@ -249,6 +249,8 @@ def frequency_of_word word
word_frequency[word]
end

class InvalidSwitchError < StandardError; end

##
# Returns the switch equivilant of this string.
#
Expand All @@ -260,8 +262,6 @@ def frequency_of_word word
# ''.switchify # => InvalidSwitchError
#

class InvalidSwitchError < StandardError; end

def switchify
raise InvalidSwitchError, 'switch must have a length > 0' if length.zero?
length > 1 ? "--#{dasherize}" : "-#{self}"
Expand Down

0 comments on commit 1335fef

Please sign in to comment.