Project

ncmb-ruby

0.0
No commit activity in last 3 years
No release in over 3 years
Forked version of ncmb-ruby-client, a simple Ruby client for the nifty cloud mobile backend REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
>= 0
 Project Readme

ncmb-ruby

Forked version of ncmb-ruby-client, a simple Ruby client for the nifty cloud mobile backend REST API.

Changes Made

  • 03/03/2015 - Added PUT and DELETE

Installation

$ gem install ncmb-ruby

Or with Bundler in your Gemfile.

gem 'ncmb-ruby'

Basic Usage

Client

require 'ncmb'

@client = NCMB.initialize application_key: application_key,  client_key: client_key

# POST data to test table
@client.request :post, "/2013-09-01/classes/test", {message: 'hello world'}

# GET data from test table
@client.request :get, "/2013-09-01/classes/test", {where: {message: 'hello world'}}

# PUT or update data in test table, assuming :objectId = SG8QsGCOVXxgOoPW
@client.request :put, "/2013-09-01/classes/test/SG8QsGCOVXxgOoPW", {message: 'good day'}

# DELETE data in test table, assuming :objectId = SG8QsGCOVXxgOoPW
@client.request :delete, "/2013-09-01/classes/test/SG8QsGCOVXxgOoPW"

Data Store

NCMB.initialize application_key: application_key,  client_key: client_key

@todo = NCMB::DataStore.new 'Todo'
@todo = @todo.limit(20).count(1).skip(0)
puts "@todo[0].name #{@todo[0].name}"

Register push notification

NCMB.initialize application_key: application_key,  client_key: client_key

@push = NCMB::Push.new
@push.immediateDeliveryFlag = true
@push.target = ['ios']
@push.message = "This is test message"
@push.deliveryExpirationTime = "3 day"
if @push.save
  puts "Push save successful."
else
  puts "Push save faild."
end

ニフティクラウド mobile backend