-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1d6794
commit 90e8643
Showing
1 changed file
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
module Ilios | ||
VERSION: String | ||
# See the writing guide of rbs: https://github.com/ruby/rbs#guides | ||
|
||
module Cassandra | ||
def self.config=: (Hash[Symbol, untyped]) -> void | ||
def self.session: () -> Ilios::Cassandra::Session | ||
def self.connect: () -> Ilios::Cassandra::Session | ||
|
||
class Session | ||
def prepare_async: (String) -> Ilios::Cassandra::Future | ||
def prepare: (String) -> Ilios::Cassandra::Statement | ||
|
||
def execute_async: (Ilios::Cassandra::Statement) -> Ilios::Cassandra::Future | ||
def execute: (Ilios::Cassandra::Statement) -> Ilios::Cassandra::Result | ||
end | ||
|
||
class Statement | ||
def bind: (Hash[Symbol, untyped] | Hash[String, untyped]) -> self | ||
def page_size: (Integer) -> self | ||
end | ||
|
||
class Future | ||
def on_success: () { (Ilios::Cassandra::Result) -> void } -> self | ||
def on_failure: () { () -> void } -> self | ||
def await: () -> Ilios::Cassandra::Future | ||
end | ||
|
||
class Result | ||
type row_type = Hash[String, untyped] | ||
|
||
include Enumerable[row_type] | ||
|
||
def each: () { (row_type) -> void } -> void | | ||
() -> ::Enumerator[row_type, self] | ||
def next_page: () -> Ilios::Cassandra::Result | | ||
() -> nil | ||
end | ||
end | ||
end |