Sha256: e62bcbdc77b81ae41eb4eb80af26a68570501cf480b6df5a2eef95b1cf6243d8

Contents?: true

Size: 621 Bytes

Versions: 55

Compression:

Stored size: 621 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

55 entries across 55 versions & 2 rubygems

Version Path
fxruby-1.6.22.pre2-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.22.pre2 lib/fox16/dict.rb
fxrubi-1.6.22.pre1-x86-mingw32 lib/fox16/dict.rb
fxrubi-1.6.22.pre1 lib/fox16/dict.rb
fxruby-1.6.20-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.20-x86-linux lib/fox16/dict.rb
fxruby-1.6.20 lib/fox16/dict.rb
fxruby-1.6.20-universal-darwin-10 lib/fox16/dict.rb
fxruby-1.6.19-x86-mingw32 lib/fox16/dict.rb
fxruby-1.6.14-mswin32 lib/fox16/dict.rb
fxruby-1.6.13-mswin32 lib/fox16/dict.rb
fxruby-1.2.3 lib/fox12/dict.rb
fxruby-1.2.2 lib/fox12/dict.rb
fxruby-1.2.4 lib/fox12/dict.rb
fxruby-1.2.5 lib/fox12/dict.rb
fxruby-1.4.0 lib/fox14/dict.rb
fxruby-1.2.6 lib/fox12/dict.rb
fxruby-1.4.1 lib/fox14/dict.rb
fxruby-1.4.2 lib/fox14/dict.rb
fxruby-1.4.3 lib/fox14/dict.rb