Module: Ethscribe

Defined in:
lib/ethscribe.rb,
lib/ethscribe.rb,
lib/ethscribe/api.rb,
lib/ethscribe/version.rb

Defined Under Namespace

Classes: Api, Configuration

Constant Summary collapse

API =

add more convenience alias - why? why not?

Api
MAJOR =

todo: namespace inside version or something - why? why not??

1
MINOR =
0
PATCH =
0
VERSION =
[MAJOR,MINOR,PATCH].join('.')

Class Method Summary collapse

Class Method Details



12
13
14
# File 'lib/ethscribe/version.rb', line 12

def self.banner
  "ethscribe/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in >#{root}<"
end

.chainObject



60
# File 'lib/ethscribe.rb', line 60

def self.chain()       config.chain; end

.chain=(value) ⇒ Object



61
# File 'lib/ethscribe.rb', line 61

def self.chain=(value) config.chain = value; end

.clientObject

add some convenience shortcut helpers (no config. required) - why? why not?



59
# File 'lib/ethscribe.rb', line 59

def self.client()      config.client; end

.configObject



56
# File 'lib/ethscribe.rb', line 56

def self.config()    @config ||= Configuration.new;  end

.configure {|config| ... } ⇒ Object

lets you use

Ordinals.configure do |config|
   config.chain = :btc
end

Yields:



55
# File 'lib/ethscribe.rb', line 55

def self.configure() yield( config ); end

.goerli?Boolean

Returns:

  • (Boolean)


65
# File 'lib/ethscribe.rb', line 65

def self.goerli?()      config.chain == 'goerli'; end

.inscribe(id_or_num) ⇒ Object



72
# File 'lib/ethscribe.rb', line 72

def self.inscribe( id_or_num )  client.ethscription( id_or_num ); end

.inscribes(**kwargs) ⇒ Object

more convenience shortcuts



71
# File 'lib/ethscribe.rb', line 71

def self.inscribes( **kwargs )  client.ethscriptions( **kwargs ); end

.mainnet?Boolean

Returns:

  • (Boolean)


64
# File 'lib/ethscribe.rb', line 64

def self.mainnet?()     config.chain == 'mainnet'; end

.rootObject



16
17
18
# File 'lib/ethscribe/version.rb', line 16

def self.root
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end

.versionObject



8
9
10
# File 'lib/ethscribe/version.rb', line 8

def self.version
  VERSION
end