ystock 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,17 @@ Get stock information from Yahoo Finance and Google (in beta)
5
5
  ## Install
6
6
  Add the following to your Gemfile
7
7
  ```ruby
8
- gem "ystock", "~> 0.3.0"
8
+ gem "ystock", "~> 0.3.4"
9
9
  ```
10
+
11
+ ### Dependancies
12
+ Please note 'httparty' is required to run this gem.
13
+
14
+
10
15
  Then run bundle install
11
16
 
17
+ ----
18
+
12
19
  # Basic Usage
13
20
 
14
21
  ## Single stock
@@ -56,4 +63,31 @@ end
56
63
  # values[:price], values[:change], values[:volume]
57
64
  puts values[:price]
58
65
  end
59
- ```
66
+ ```
67
+
68
+ ----
69
+
70
+ # Google Stock (Beta)
71
+ I have added Google finance to this gem due to the number of stocks not supported by Yahoo.
72
+
73
+ ## Usage for multiple stocks
74
+
75
+ ```
76
+ @stocks = Ystock::Google.find(["aapl","goog"])
77
+
78
+ <%=@stocks[:AAPL][:price]%>
79
+ <%=@stocks[:AAPL][:change]%>
80
+ <%=@stocks[:AAPL][:volume]%>
81
+ <%=@stocks[:AAPL][:market]%>
82
+ ```
83
+
84
+ ```ruby
85
+ @stocks.each do |sym, value|
86
+ puts value[:price]
87
+ end
88
+ ```
89
+
90
+ #### Sample response
91
+ ```
92
+ {:AAPL=>{:symbol=>"AAPL", :market=>"Nasdaq", :price=>"598.90", :change=>"-5.53", :volume=>"15285309"}, :GOOG=>{:symbol=>"GOOG", :market=>"Nasdaq", :price=>"570.48", :change=>"-0.71", :volume=>"2310094"}}
93
+ ```
@@ -34,7 +34,8 @@ module Ystock
34
34
  :market => stock["exchange"]["data"],
35
35
  :price => stock["last"]["data"],
36
36
  :change => stock["change"]["data"],
37
- :volume => stock["volume"]["data"]
37
+ :volume => stock["volume"]["data"],
38
+ :company => stock["company"]["data"]
38
39
  }
39
40
  end
40
41
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ystock}
5
- s.version = "0.3.4"
5
+ s.version = "0.3.5"
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ystock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: