ystock 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +5 -0
  2. data/lib/ystock.rb +15 -0
  3. data/ystock.gemspec +1 -1
  4. metadata +1 -1
data/README.rdoc CHANGED
@@ -23,6 +23,11 @@ This gem uses Yahoo Finance (yahoo.finance.com) to get stock quotes. Remember th
23
23
  # :price
24
24
  # :change
25
25
  # :volume
26
+
27
+ Get multiple stock information at once.
28
+
29
+ Ystock.find(['aapl', 'goog', 'lcre'])
30
+
26
31
 
27
32
  == Build by
28
33
 
data/lib/ystock.rb CHANGED
@@ -16,7 +16,22 @@ module Ystock
16
16
  end
17
17
 
18
18
  @@service_uri = "http://download.finance.yahoo.com/d/quotes.csv"
19
+
20
+ # Ystock.find(['stock', 'stock'])
21
+ def find(args)
22
+ output = Array.new
23
+ args.each do |stock|
24
+ s = send_request(stock.to_s)
25
+ a = s.chomp.split(",")
26
+ output << {:symbol => stock.to_s,
27
+ :price => a[0],
28
+ :change => a[1],
29
+ :volume => a[2]}
19
30
 
31
+ end
32
+ return output
33
+ end
34
+
20
35
  def self.get_stock(stock)
21
36
  output = Array.new
22
37
  s = send_request(stock)
data/ystock.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ystock}
5
- s.version = "0.2.1"
5
+ s.version = "0.2.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Greg Winn"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ystock
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Greg Winn