Skip to content

Instantly share code, notes, and snippets.

@kemelzaidan
Created April 4, 2016 19:51
Show Gist options
  • Save kemelzaidan/de2bc637da9a9ba8ebb7b84216dc9740 to your computer and use it in GitHub Desktop.
Save kemelzaidan/de2bc637da9a9ba8ebb7b84216dc9740 to your computer and use it in GitHub Desktop.
remote storage Recipe Module
RemoteStorage.defineModule('recipe', function(privateClient, publicClient) {
var baseProperties = {
"oven_temp": {
"description": "celsius or farenheit",
"type": "object",
"properties": {
"amount": {"type": "integer"},
"unit": {"type": "string", "enum": ["F", "C"]}
}
},
"servings": {
"type": "number"
},
"source_url": {
"description": "original recipe URL",
"type": "string"
},
"ingredients": {
"type": "object",
"properties": {
"ingredient": {"type": "string"},
"amount": {"type": "number"},
"unit": {"type": "string"},
}
},
"steps": {
"description": "steps necessary for the recipe",
"type": "object",
"properties": {
"step": {"type": "string"}
}
}
};
privateClient.declareType('recipe', {
"description": "Open Recipe Format",
"type": "object",
"properties": extend ({
"id": {
"type": "string",
"format": "id"
},
"name": {
"type": "string"
}
}, baseProperties)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment