Sha256: c37e8ac2b8e4e45bd98058901ee87e7781f7ff424b90dd68d7b8b01a6c179ca7

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

require_relative '../crypto_compare.rb'

class CryptoCompare::CryptoCurrency
	attr_accessor :name, :price, :market_cap, :circulating_supply, :volume, :percent_change
	@@all = []

	def initialize(data)
		data.each{|key,value| self.send("#{key}=",value)} 
		@@all << self if !@@all.detect {|crypto| crypto.name == self.name}
	end	

	def self.all
		@@all
	end

	def self.make_crypto_from_list(list, scraper)
		list.each {|crypto| CryptoCompare::CryptoCurrency.new(scraper.get_attributes(crypto, scraper.page))}
		self.all
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crypto_compare-0.1.13 lib/crypto_compare/crypto_currency.rb