Class: OttomanORM::Datastore
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #create(name, data) ⇒ Object
- #get(name, id) ⇒ Object
- #get_by_field(name, field, value) ⇒ Object
-
#initialize(parameters) ⇒ Datastore
constructor
A new instance of Datastore.
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
#client ⇒ Object
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 |