configure do
CASSANDRA_DB = ...
end
class CassandraDB
def self. establish_connection!
@connection = ...
enddef disconnect!
...
enddef initialize; ...; enddef some_other_instance_method; ...; end
endbefore do
CassandraDB.establish_connection!
endafter do
CassandraDB.disconnect!
endget '/' do
# use your connection here and throughout your application'done'
end
Hi guys,--
I'm a little lost trying to get working sinatra with cassandra. This two technologies are going to be the base of my new app, and I wanna get it right.
¿Do you have any example about how to connect this to guys??
What I can't figure out is where to put the DB code so every file in my APP gets access thi this DB connection.
Huge thanks ;)
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sinatrarb/-/WqevEpCh69AJ.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.