New kittyverse library / gem - helper classes for cattributes, trait types, traits, genes, genomes and more for cryptokitties and copycats cryptocollectibles (on the blockchain)


(Gerald Bauer) #1

Hello,

   I've put together a new kittyverse library / gem [1] that includes
helper classes for cattributes, trait types, traits, genes, genomes
and more for cryptokitties and copycats cryptocollectibles (on the
blockchain). Example usage for trait lookups:

require 'kittyverse'

t = Traits[ 'FU00' ]
p t.class #=> Trait
p t.name #=> "savannah"
p t.type.name #=> "Fur"
p t.code #=> "FU00"
p t.kai #=> "1"

# -or-

t = Trait.find_by_code( 'FU00' )
t = Trait.find_by( code: 'FU00' )
t = Traits[ 'savannah' ]
t = Traits[ 'Savannah' ]
t = Trait.find_by_name( 'Savannah' )
t = Trait.find_by( name: 'Savannah' )
t = Traits[ :body ][ '1' ]
t = Traits[ :body ][ '00' ]
t = Traits[ :body ][ 0 ]
t = Traits[ 'FU' ][ '00' ]
t = Traits[ 'FU' ][0]
t = Traits[ :FU ][0]
t = Traits[ :FU00 ]
t = Traits[ 'Fur' ][0]
# ...

   Or generate a dataset in json [2] for all fancy, exclusive and
special edition cats:

require 'kittyverse'

File.open( 'build/fancies.json', 'w:utf-8' ) do |f|
   f.write JSON.pretty_generate( FANCIES )
end

  And much more. Happy data wrangling and bits & bytes slicing w/
ruby. Cheers. Prost.

[1] https://github.com/cryptocopycats/kittyverse
[2] https://github.com/cryptocopycats/kittyverse.json