mirror of
https://github.com/bumi/openalias-ruby
synced 2026-02-15 08:07:49 +00:00
Add currency lookup helpers
add ? methods to for simple currency selection:
Openalias.addresses('donate@getmonero.org').find(&:xmr?)
This commit is contained in:
@@ -3,7 +3,16 @@ require 'ostruct'
|
||||
|
||||
class Openalias
|
||||
VERSION = "0.1.0"
|
||||
class CryptoAddress < OpenStruct; end
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user