Class: Pasture::API
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Pasture::API
- Includes:
- Cowsay
- Defined in:
- lib/pasture/api.rb
Instance Method Summary collapse
-
#initialize ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize ⇒ API
Returns a new instance of API.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pasture/api.rb', line 12 def initialize super() puts settings.[:db] puts 'true' if settings.[:db] if settings.[:db] @conn = Sequel.connect(settings.[:db]) unless @conn.table_exists?(:sayings) @conn.create_table :sayings do primary_key :id String :message end end end end |