Sha256: a1601bcc0b0aa458a8a1864f455a141fce6f72350162b0d27943832e051d643c

Contents?: true

Size: 617 Bytes

Versions: 100

Compression:

Stored size: 617 Bytes

Contents

#
# Adds some methods similar to those for Ruby's Hash class
# to FOX's FXDict class.
#
module Fox
  class FXDict
    #
    # Returns a new array populated with the keys from this dictionary.
    #
    def keys
      ary = []
      each_key { |k| ary << k }
      ary
    end

    #
    # Iterate over the keys in this dictionary.
    #
    def each_key
      pos = first
      while pos < self.getTotalSize()
        yield key(pos)
        pos = self.next(pos)
      end
    end

    #
    # Returns +true+ if this dictionary contains no key-value pairs.
    #
    def empty?
      self.size == 0
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
fxruby-1.6.48 lib/fox16/dict.rb
fxruby-1.6.48-x64-mingw32 lib/fox16/dict.rb
fxruby-1.6.48-x64-mingw-ucrt lib/fox16/dict.rb
fxruby-1.6.48-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.47 lib/fox16/dict.rb
fxruby-1.6.47-x64-mingw-ucrt lib/fox16/dict.rb
fxruby-1.6.47-x64-mingw32 lib/fox16/dict.rb
fxruby-1.6.47-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.46 lib/fox16/dict.rb
fxruby-1.6.46-x64-mingw32 lib/fox16/dict.rb
fxruby-1.6.46-x64-mingw-ucrt lib/fox16/dict.rb
fxruby-1.6.46-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.45 lib/fox16/dict.rb
fxruby-1.6.45-x64-mingw32 lib/fox16/dict.rb
fxruby-1.6.45-x64-mingw-ucrt lib/fox16/dict.rb
fxruby-1.6.45-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.44 lib/fox16/dict.rb
fxruby-1.6.44-x64-mingw32 lib/fox16/dict.rb
fxruby-1.6.44-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.43 lib/fox16/dict.rb