Class: NCMB::DataStore

Inherits:
Object
  • Object
show all
Defined in:
lib/ncmb/data_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, name) ⇒ DataStore

Returns a new instance of DataStore.



4
5
6
7
# File 'lib/ncmb/data_store.rb', line 4

def initialize(client, name)
  @client = client
  @name   = name
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/ncmb/data_store.rb', line 3

def client
  @client
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/ncmb/data_store.rb', line 3

def name
  @name
end

Instance Method Details

#get(queries = {}) ⇒ Object



9
10
11
12
# File 'lib/ncmb/data_store.rb', line 9

def get(queries = {})
  path = "/#{@client.api_version}/classes/#{@name}"
  @client.get path, queries
end

#post(queries = {}) ⇒ Object



14
15
16
17
# File 'lib/ncmb/data_store.rb', line 14

def post(queries = {})
  path = "/#{@client.api_version}/classes/#{@name}"
  @client.post path, queries
end