Skip to content

Commit

Permalink
Update RBS definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Nov 23, 2023
1 parent b1d6794 commit 90e8643
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion sig/ilios.rbs
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

0 comments on commit 90e8643

Please sign in to comment.