Sha256: a0c466e3aac22c819ef43ed39c8df886e35060c3a5cee1e898e72190080273fc

Contents?: true

Size: 637 Bytes

Versions: 26

Compression:

Stored size: 637 Bytes

Contents

#--
# Credit goes to Phil Tomson.
#++

class String

  # Is the string upcase/uppercase?
  #
  #   "THIS".upcase?  #=> true
  #   "This".upcase?  #=> false
  #   "this".upcase?  #=> false
  #
  def upcase?
    self.upcase == self
  end

  # Alias for #upcase? method.
  alias_method( :uppercase?, :upcase? )

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_upcase?
      assert( 'ABC'.upcase? )
    end

    def test_uppercase?
      assert( 'ABC'.uppercase? )
    end

  end

=end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
facets-1.0.0 lib/facet/string/upcase.rb
facets-0.9.0 lib/nano/string/upcase.rb
facets-1.0.3 packages/core/lib/facet/string/upcase.rb
facets-1.1.0 lib/facet/string/upcase.rb
facets-1.2.0 lib/facets/core/string/upcase.rb
facets-1.2.1 lib/facets/core/string/upcase.rb
facets-1.3.0 lib/facets/core/string/upcase.rb
facets-1.3.1 lib/facets/core/string/upcase.rb
facets-1.3.2 lib/facets/core/string/upcase.rb
facets-1.3.3 lib/facets/core/string/upcase.rb
facets-1.4.0 lib/facets/core/string/upcase.rb
facets-1.4.1 lib/facets/core/string/upcase.rb
facets-1.4.2 lib/facets/core/string/upcase.rb
facets-1.4.3 lib/facets/core/string/upcase.rb
facets-1.4.4 lib/facets/core/string/upcase.rb
facets-1.4.5 lib/facets/core/string/upcase.rb
facets-1.7.0 lib/facets/core/string/upcase.rb
facets-1.7.30 lib/facets/core/string/upcase.rb
facets-1.7.38 lib/facets/core/string/upcase.rb
facets-1.7.46 lib/facets/core/string/upcase.rb