Sha256: 8e92caef3f24dd89373bbfc0dbe20a1c0e577153ad1afd0b1a0aeb67788c6f40

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 Bytes

Contents

# try try/10_basics_try.rb

require 'boned'
#Bone.debug = true
Bone.source = "http://localhost:3073"  
Bone.credentials = 'atoken:crystal'

## Bone.register
Bone.register Bone.token, Bone.secret
#=> 'atoken'

## Bone.register is not possible for existing key
Bone.register Bone.token, Bone.secret
#=> nil

## Bone.generate
@token, @secret = *Bone.generate
@token.size
#=> 24

## Can destroy a token
Bone.destroy @token
#=> true

## Cannot destroy a token that doesn't exist
Bone.destroy 'bogus'
#=> false

## Bone.get returns nil for bad key
Bone['bogus']
#=> nil

## Bone.keys returns empty array
Bone.keys
#=> []

Bone.destroy Bone.token

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
boned-0.3.1 try/10_basics_try.rb
boned-0.3.0 try/10_basics_try.rb