1
0
mirror of https://github.com/bumi/openalias-ruby synced 2025-06-16 06:58:13 +00:00
openalias-ruby/lib/openalias.rb
bumi 30e9a0d805 Add currency lookup helpers
add ? methods to for simple currency selection:
Openalias.addresses('donate@getmonero.org').find(&:xmr?)
2018-11-03 18:30:37 +01:00

23 lines
519 B
Ruby

require 'thermite/fiddle'
require 'ostruct'
class Openalias
VERSION = "0.1.0"
class CryptoAddress < OpenStruct;
def method_missing(method_name, *args, &block)
if symbol = method_name[/(.*)\?\z/, 1]
self.cryptocurrency.to_s.downcase === symbol.to_s.downcase
else
super
end
end
end
toplevel_dir = File.dirname(File.dirname(__FILE__))
Thermite::Fiddle.load_module('init_openalias_rust',
cargo_project_path: toplevel_dir,
ruby_project_path: toplevel_dir)
end