Class: Algorand::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/algorand/configuration.rb

Constant Summary collapse

DEFAULT_ALGOD_HOST =
'localhost:4001'
DEFAUT_INDEXER_HOST =
'localhost:8980'
DEFAULT_KMD_HOST =
'localhost:4002'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
# File 'lib/algorand/configuration.rb', line 16

def initialize
  set_defaults
end

Instance Attribute Details

#algod_hostObject (readonly)

Returns the value of attribute algod_host.



6
7
8
# File 'lib/algorand/configuration.rb', line 6

def algod_host
  @algod_host
end

#indexer_hostObject (readonly)

Returns the value of attribute indexer_host.



6
7
8
# File 'lib/algorand/configuration.rb', line 6

def indexer_host
  @indexer_host
end

#kmd_hostObject (readonly)

Returns the value of attribute kmd_host.



6
7
8
# File 'lib/algorand/configuration.rb', line 6

def kmd_host
  @kmd_host
end

Class Method Details

.set_defaultsObject



12
13
14
# File 'lib/algorand/configuration.rb', line 12

def self.set_defaults
  instance.set_defaults
end

Instance Method Details

#configure(options) ⇒ Object



20
21
22
23
24
# File 'lib/algorand/configuration.rb', line 20

def configure(options)
  @algod_host = options[:algod_host]
  @indexer_host = options[:indexer_host]
  @kmd_host = options[:kmd_host]
end