class AngryRaise::String
Public Class Methods
new(str)
click to toggle source
# File lib/angry_raise.rb, line 62 def initialize(str) @str = str.to_s @level = 1 end
Public Instance Methods
!()
click to toggle source
# File lib/angry_raise.rb, line 67 def ! @level += 1 self end
inspect()
click to toggle source
# File lib/angry_raise.rb, line 78 def inspect rageify.inspect end
to_s()
click to toggle source
# File lib/angry_raise.rb, line 72 def to_s rageify.dup end
Also aliased as: to_str
Private Instance Methods
rageify()
click to toggle source
# File lib/angry_raise.rb, line 84 def rageify return @str if @str.strip.empty? s = case @level when 1 @str + "!" when 2 @str.capitalize << "!!" when 3 @str.split(/(\s+)/).map(&:capitalize).join("") << "!!!" else @str.upcase << "!" * @level end # Should ENV be used too? s.prepend("ยก" * @level) if defined?(I18n) && I18n.locale =~ /\Aes(?:_|\b)/ s end