Class: OttomanORM::Datastore

Inherits:
Object
  • Object
show all
Defined in:
lib/ottoman_orm/datastore.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters) ⇒ Datastore

Returns a new instance of Datastore.



6
7
8
# File 'lib/ottoman_orm/datastore.rb', line 6

def initialize parameters
    self.connect parameters
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/ottoman_orm/datastore.rb', line 4

def client
  @client
end

Instance Method Details

#create(name, data) ⇒ Object



10
11
12
# File 'lib/ottoman_orm/datastore.rb', line 10

def create name, data
    execute_sproc(name + '_create', data)
end

#get(name, id) ⇒ Object



14
15
16
# File 'lib/ottoman_orm/datastore.rb', line 14

def get name, id
    execute_sproc(name + '_get', id).values()
end

#get_by_field(name, field, value) ⇒ Object



18
19
20
# File 'lib/ottoman_orm/datastore.rb', line 18

def get_by_field name, field, value
    execute_sproc(name + '_get_by_' + field, value).values()
end