Class: Ethscribe::Configuration
- Inherits:
-
Object
- Object
- Ethscribe::Configuration
- Defined in:
- lib/ethscribe.rb
Instance Method Summary collapse
- #chain ⇒ Object
-
#chain=(value) ⇒ Object
accessors.
-
#client ⇒ Object
note: read-only for now - why? why not?.
- #delay_in_s ⇒ Object (also: #sleep)
- #delay_in_s=(value) ⇒ Object (also: #sleep=)
Instance Method Details
#chain ⇒ Object
27 28 29 30 31 |
# File 'lib/ethscribe.rb', line 27 def chain ## note - default to mainnet if not set self.chain = 'mainnet' unless defined?( @chain ) @chain end |
#chain=(value) ⇒ Object
accessors
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ethscribe.rb', line 10 def chain=(value) if value.is_a?( String ) || value.is_a?( Symbol ) case value.downcase.to_s when 'mainnet' # 'main', 'eth', 'prod', 'production' @chain = 'mainnet' @client = Ethscribe::Api.mainnet when 'goerli' # 'testnet', 'test' @chain = 'goerli' @client = Ethscribe::Api.goerli else raise ArgumentError, "unknown chain - expected mainnet | goerli; got #{value}" end else raise ArgumentError, "only string or symbol supported for now; sorry - got: #{value.inspect} : #{value.class.name}" end end |
#client ⇒ Object
note: read-only for now - why? why not?
34 35 36 37 38 |
# File 'lib/ethscribe.rb', line 34 def client ## note - default to btc/ if not set self.chain = 'mainnet' unless defined?( @client ) @client end |
#delay_in_s ⇒ Object Also known as: sleep
40 41 42 43 44 |
# File 'lib/ethscribe.rb', line 40 def delay_in_s ## note - default to 1 (sec) if not set self.delay_in_s = 1 unless defined?( @delay_in_s ) @delay_in_s end |
#delay_in_s=(value) ⇒ Object Also known as: sleep=
45 |
# File 'lib/ethscribe.rb', line 45 def delay_in_s=(value) @delay_in_s = value; end |