Sha256: 6f12d039445bdef2b60e70b22adc3efe61d01b92eaf6158abe9da2283cbda308

Contents?: true

Size: 955 Bytes

Versions: 1

Compression:

Stored size: 955 Bytes

Contents

require_relative '../lib/familia'
require_relative './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.delete!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
familia-1.1.0.pre.rc1 try/25_redis_type_hash_try.rb