Class: QuicknodeSdk::SDK
- Inherits:
-
Object
- Object
- QuicknodeSdk::SDK
- Defined in:
- lib/quicknode_sdk/sdk.rb
Class Method Summary collapse
-
.from_config(opts) ⇒ Object
Build an SDK from an explicit config hash.
- .from_env ⇒ Object
Instance Method Summary collapse
- #admin ⇒ Object
-
#initialize(native) ⇒ SDK
constructor
A new instance of SDK.
- #kvstore ⇒ Object
- #streams ⇒ Object
- #webhooks ⇒ Object
Constructor Details
#initialize(native) ⇒ SDK
Returns a new instance of SDK.
18 19 20 |
# File 'lib/quicknode_sdk/sdk.rb', line 18 def initialize(native) @native = native end |
Class Method Details
.from_config(opts) ⇒ Object
Build an SDK from an explicit config hash. Supports custom headers, timeouts, and base URLs without relying on env vars.
QuicknodeSdk::SDK.from_config(
api_key: "...",
http: { headers: { "X-Correlation-Id" => "abc" } }
)
14 15 16 |
# File 'lib/quicknode_sdk/sdk.rb', line 14 def self.from_config(opts) new(Native::SDK.from_config(opts)) end |
.from_env ⇒ Object
3 4 5 |
# File 'lib/quicknode_sdk/sdk.rb', line 3 def self.from_env new(Native::SDK.from_env) end |
Instance Method Details
#admin ⇒ Object
22 23 24 |
# File 'lib/quicknode_sdk/sdk.rb', line 22 def admin Admin.new(@native.admin) end |
#kvstore ⇒ Object
34 35 36 |
# File 'lib/quicknode_sdk/sdk.rb', line 34 def kvstore KvStore.new(@native.kvstore) end |