built.io is a Backend-as-a-Service. This is the ruby SDK providing convenient wrappers for working with built.io.
WARNING: This gem is no longer officially supported by Built IO.
gem install built.io
Call the init
method on Built
to initialize the SDK with your
application's api_key:
Built.init(
:application_api_key => "<your api key>",
:master_key => "<your master key>"
)
obj = Built::Object.fetch("people", "bltMyU1d")
obj = Built::Object.new("people")
obj["name"] = "James"
obj["age"] = 32
obj.save
If you already have objects from a query, just set the attributes and save:
obj["age"] = 43
obj.save
If you just have the object's uid
, set it first:
obj.uid = "bltMyU1d"
obj["age"] = 43
obj.save
obj.destroy
query = Built::Query.new("people")
query
.containedIn("name", ["James"])
.greaterThan("age", 30)
.include_count
result = query.exec
puts result.objects[0]
puts result.count