Sha256: 5195a9d41d07c4831fe69267a5c5643efb12310f6f7cacad24647bc4b1637b7b

Contents?: true

Size: 935 Bytes

Versions: 16

Compression:

Stored size: 935 Bytes

Contents

require 'familia'
require 'familia/test_helpers'

@a = Bone.new 'atoken', 'akey'

## Familia::HashKey#has_key? knows when there's no key
@a.props.has_key? 'fieldA'
#=> false

## Familia::HashKey#[]=
@a.props['fieldA'] = '1'
@a.props['fieldB'] = '2'
@a.props['fieldC'] = '3'
#=> '3'

## Familia::HashKey#[]
@a.props['fieldA']
#=> '1'

## Familia::HashKey#has_key? knows when there's a key
@a.props.has_key? 'fieldA'
#=> true

## Familia::HashKey#all 
@a.props.all.class
#=> Hash

## Familia::HashKey#size counts the number of keys
@a.props.size
#=> 3

## Familia::HashKey#remove
@a.props.remove 'fieldB'
#=> 1

## Familia::HashKey#values
@a.props.values.sort
#=> ['1', '3']

## Familia::HashKey#increment
@a.props.increment 'counter', 100
#=> 100

## Familia::HashKey#decrement
@a.props.decrement 'counter', 60
#=> 40

## Familia::HashKey#values_at
@a.props.values_at 'fieldA', 'counter', 'fieldC'
#=> ['1', '40', '3']


@a.props.clear

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
familia-0.10.2 try/25_redis_object_hash_try.rb
familia-0.10.1 try/25_redis_object_hash_try.rb
familia-0.10.0 try/25_redis_object_hash_try.rb
familia-0.9.3 try/25_redis_object_hash_try.rb
familia-0.9.2 try/25_redis_object_hash_try.rb
familia-0.9.1 try/25_redis_object_hash_try.rb
familia-0.9.0 try/25_redis_object_hash_try.rb
familia-0.7.1 try/25_redis_object_hash_try.rb
familia-0.7.0 try/25_redis_object_hash_try.rb
familia-0.6.10 try/25_redis_object_hash_try.rb
familia-0.6.9 try/25_redis_object_hash_try.rb
familia-0.6.8 try/25_redis_object_hash_try.rb
familia-0.6.4 try/25_redis_object_hash_try.rb
familia-0.6.3 try/25_redis_object_hash_try.rb
familia-0.6.2 try/25_redis_object_hash_try.rb
familia-0.6.1 try/25_redis_object_hash_try.rb