Skip to content
vic

bakkdoor/ripple.fy

Fancy wrapper for Ripple, Ruby's rich modeling layer for Riak.

bakkdoor/ripple.fy.json
{
"createdAt": "2012-08-30T00:40:21Z",
"defaultBranch": "master",
"description": "Fancy wrapper for Ripple, Ruby's rich modeling layer for Riak.",
"fullName": "bakkdoor/ripple.fy",
"homepage": null,
"language": "Fancy",
"name": "ripple.fy",
"pushedAt": "2012-12-24T11:56:47Z",
"stargazersCount": 2,
"topics": [],
"updatedAt": "2017-06-05T18:40:52Z",
"url": "https://github.com/bakkdoor/ripple.fy"
}

A Fancy wrapper for Ripple, Ruby’s rich modeling layer for Riak.

Section titled “A Fancy wrapper for Ripple, Ruby’s rich modeling layer for Riak.”

This package exposes Ripple (https://github.com/seancribbs/ripple) to Fancy in an idiomatic way. You can easily define Model properties and relationships that are backed by and stored in Riak, the distributed key-value database.

Example usage:

class Person # forward declaration due to reference in Pet class below
class Pet {
include: Ripple Model
properties: {
name: { type: String }
}
key: 'name
has_one: 'person type: Person
}
class Person {
include: Ripple Model
properties: {
name: { type: String }
age: { type: Fixnum }
}
key: 'name
has_many: 'pets type: Pet
}
# Let's create a Person (create automatically saves it to Riak after creation):
tom = Person create: @{
name: "Tom Tucker"
age: 55
}
kitty = Pet create: @{
name: "Kitty Cat"
person: tom
}
tom save: @{ pets << kitty } # add kitty to tom's pets and save tom
# Find Tom by his key:
tom = Person find: "Tom Tucker" # as defined above, the key for a Person is its name
# find: returns nil if the given key is invalid.
# alternatively use find!: which raises an Exception if given an invalid key:
tom = Person find!: "Tom Tucker"

(C) 2012 Christopher Bertels chris@fancy-lang.org

Released under the same license as Ripple: Apache License, Version 2.0