Sha256: 74b7f16e9b39952af7416c67f19881aff78f7699c16b3273d270ccf3fe88ea94

Contents?: true

Size: 265 Bytes

Versions: 10

Compression:

Stored size: 265 Bytes

Contents

require 'facets/string/words'

class String

  # Iterate through each word of a string.
  #
  #   a = []
  #
  #   "list of words".each_word { |word| a << word }
  #
  #   a  #=> ['list', 'of', 'words']
  #
  def each_word(&block)
    words.each(&block)
  end

end

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/string/each_word.rb
facets-3.1.0 lib/core/facets/string/each_word.rb
facets-3.0.0 lib/core/facets/string/each_word.rb
facets-2.9.3 lib/core/facets/string/each_word.rb
facets-2.9.2 src/core/facets/string/each_word.rb
facets-2.9.2 lib/core/facets/string/each_word.rb
facets-2.9.1 lib/core/facets/string/each_word.rb
facets-2.9.0 lib/core/facets/string/each_word.rb
facets-2.9.0.pre.2 lib/core/facets/string/each_word.rb
facets-2.9.0.pre.1 lib/core/facets/string/each_word.rb