LeanCloud SDK for Ruby
Add this line to your application's Gemfile:
gem 'avos', git: "https://github.com/loveltyoic/avos-ruby-sdk.git"
And then execute:
$ bundle
AVOS.init do |avos|
avos.app_id = APP_ID
avos.app_key = APP_KEY
end
- Create Object
game_score = AVOS::Object.new("GameScore", {
"score" => 1337,
"playerName" => "Sean Plott",
"cheatMode" => false })
- Save Object
game_score.save
- Update Object
game_score.update({"score" => 1000})
- Delete Object
game_score.delete
query = AVOS::Query.new("Set")
query.find(game_score.avos_id)
query.where({"playerName" => "Sean Plott"})
query.count({"cheatMode" => false})
- Upload
file = AVOS::File.new("folder/image_name.jpg")
If you want assign file name at avos
file.upload("filename_at_avos")
or just
file.upload
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request