Class: Ordinals::Configuration

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

Instance Method Summary collapse

Instance Method Details

#chainObject



77
78
79
80
81
# File 'lib/ordinals.rb', line 77

def chain
  ## note - default to btc/bitcon if not set
  self.chain = 'btc'   unless defined?( @chain )
  @chain
end

#chain=(value) ⇒ Object

accessors



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/ordinals.rb', line 57

def chain=(value)
    if value.is_a?( String ) || value.is_a?( Symbol )
        case value.downcase.to_s
        when 'btc', 'bitcoin', 'bitcon'
           @chain  = 'btc'
           @client = Ordinals::Api.bitcoin
        when 'ltc', 'litecoin', 'litecon'
           @chain = 'ltc'
           @client = Ordinals::Api.litecoin
        when 'doge', 'dogecoin', 'dogecon'
           @chain = 'doge'
           @client = Ordinals::Api.dogecoin
        else
          raise ArgumentError, "unknown chain - expected btc | ltc | doge; got #{value}"
        end
    else
        raise ArgumentError, "only string or symbol supported for now; sorry - got: #{value.inspect} : #{value.class.name}"
    end
end

#clientObject

note: read-only for now - why? why not?



84
85
86
87
88
# File 'lib/ordinals.rb', line 84

def client
  ## note - default to btc/bitcon if not set
  self.chain = 'btc'   unless defined?( @client )
  @client
end

#delay_in_sObject Also known as: sleep



90
91
92
93
94
# File 'lib/ordinals.rb', line 90

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=



95
# File 'lib/ordinals.rb', line 95

def delay_in_s=(value) @delay_in_s = value; end