Module: Ethname

Defined in:
lib/ethname.rb,
lib/ethname/version.rb,
lib/ethname/directory.rb

Defined Under Namespace

Classes: Directory, Record

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.[](q) ⇒ Object



23
24
25
# File 'lib/ethname.rb', line 23

def self.[]( q )
  dir[ q ]
end


13
14
15
# File 'lib/ethname/version.rb', line 13

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

.dirObject Also known as: directory



12
13
14
15
16
17
18
# File 'lib/ethname.rb', line 12

def self.dir
   @dir ||= Directory.read( "#{root}/config/contracts.2017.csv",
                            "#{root}/config/contracts.2021.csv",
                            "#{root}/config/contracts.2022.csv",
                            "#{root}/config/contracts.2023.csv",
                            )
end

.rootObject



17
18
19
# File 'lib/ethname/version.rb', line 17

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

.versionObject



9
10
11
# File 'lib/ethname/version.rb', line 9

def self.version
  VERSION
end