Class: Siwe::Config::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/siwe/config.rb

Overview

Mutable struct used inside Siwe.configure { |c| c.rpc_url = … }. Caller mutates fields, then build returns a frozen Config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rpc_url: nil, rpc: nil, adapter: nil) ⇒ Builder

Returns a new instance of Builder.



28
29
30
31
32
# File 'lib/siwe/config.rb', line 28

def initialize(rpc_url: nil, rpc: nil, adapter: nil)
  @rpc_url = rpc_url
  @rpc = rpc
  @adapter = adapter
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



26
27
28
# File 'lib/siwe/config.rb', line 26

def adapter
  @adapter
end

#rpcObject

Returns the value of attribute rpc.



26
27
28
# File 'lib/siwe/config.rb', line 26

def rpc
  @rpc
end

#rpc_urlObject

Returns the value of attribute rpc_url.



26
27
28
# File 'lib/siwe/config.rb', line 26

def rpc_url
  @rpc_url
end

Instance Method Details

#buildObject



34
35
36
# File 'lib/siwe/config.rb', line 34

def build
  Config.new(rpc_url: @rpc_url, rpc: @rpc, adapter: @adapter)
end