Sha256: ec13d02072aa3061310fb22f66a30975ea33795d9ec6c5875e379658380346ec
Contents?: true
Size: 518 Bytes
Versions: 3
Compression:
Stored size: 518 Bytes
Contents
module BitShares class Asset attr_reader :id, :name def initialize hash @id = hash['id'] @name = hash['symbol'] @hash = hash self.class.add self end def to_s @name end class << self def [] id if /^\d\.\d*\.\d*/.match(id) BitShares.assets id unless hash.key? id hash[id] else hash.each_pair do |k,v| return v if v.name == id end end end def add h hash[h.id] = h unless hash.key? h.id end def hash() @h ||= {} end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bitsharesws-0.0.3 | lib/bitshares/asset.rb |
bitsharesws-0.0.2 | lib/bitshares/asset.rb |
bitsharesws-0.0.1 | lib/bitshares/asset.rb |