Sha256: 6c1d63170588bccdfcaf0c62b71c04ab4433a22bfed9df20a29599601d5b18ad

Contents?: true

Size: 943 Bytes

Versions: 8

Compression:

Stored size: 943 Bytes

Contents

require 'familia'
require 'familia/test_helpers'

## Has all redis objects
redis_objects = Familia::RedisObject.registration.keys
redis_objects.collect(&:to_s).sort
#=> ["hash", "list", "set", "string", "zset"]

## Familia created class methods for redis object class
Familia::ClassMethods.public_method_defined? :list?
#=> true

## Familia created class methods for redis object class
Familia::ClassMethods.public_method_defined? :list
#=> true

## Familia created class methods for redis object class
Familia::ClassMethods.public_method_defined? :lists
#=> true

## A Familia object knows its redis objects
Bone.redis_objects.is_a?(Hash) && Bone.redis_objects.has_key?(:owners)
#=> true

## A Familia object knows its lists
Bone.lists.size
#=> 1

## A Familia object knows if it has a list
Bone.list? :owners
#=> true

## A Familia object can get a specific redis object def
definition = Bone.list :owners
definition.klass
#=> Familia::List

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
familia-0.7.0 try/10_familia_try.rb
familia-0.6.10 try/10_familia_try.rb
familia-0.6.9 try/10_familia_try.rb
familia-0.6.8 try/10_familia_try.rb
familia-0.6.4 try/10_familia_try.rb
familia-0.6.3 try/10_familia_try.rb
familia-0.6.2 try/10_familia_try.rb
familia-0.6.1 try/10_familia_try.rb