Sha256: 437cca6665b23b7588c091c4c1059c77fbb86fe5434291b435fc31b2f37ddc2a
Contents?: true
Size: 458 Bytes
Versions: 5
Compression:
Stored size: 458 Bytes
Contents
require 'yaml' class StockInfo def initialize(values={}) @name = values['name'] @name2 = values['name2'] @url = values['url'] @symbol = values['symbol'] @price = values['price'] @change = values['change'] @ratio = values['ratio'] end attr_accessor :name, :name2, :url, :symbol, :price, :change, :ratio end ydoc = YAML.load_file('bench_context.yaml') @list = ydoc['list'].collect { |values| StockInfo.new(values) }
Version data entries
5 entries across 5 versions & 1 rubygems