stocks 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stocks/quote.rb +21 -19
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aaf935fa30015a7d522d988c453476978fd429df
4
- data.tar.gz: 858b612f40c17f3144d633a06c41cdf0f479b899
3
+ metadata.gz: 911fce4a35b7e344b06251c4ea2fc44ca0c9e817
4
+ data.tar.gz: 26f40e4ef0111cff2adcdf6093db36984e1e6d13
5
5
  SHA512:
6
- metadata.gz: 42cade0497d0503ce34492ccb85604c03a827e62ff4db6de63a5b3d570979b274dd00322eacce248970cbcca9a4338bb10d4167f76504e36122ac5f9cf26d70b
7
- data.tar.gz: efbda82899547a538d324be44cb9824cf9b06f2aecbc262b039ed933d5fe3edd864d9a766cc00880f1b98b9b3473e3dd159867955817b83d776d201f2c8e9699
6
+ metadata.gz: 032e3ff200dea1284fe9b1bed083185ed04cb12f591f42a6cde96404270e2b5006a8216c8b17dd6075a89c596db2282788fbc4ae971688592380d266e035fbc1
7
+ data.tar.gz: efaf177ee08f5ee4ad964264e5be6f21e9de71ea945f91a1c35162b7f46bdfb6d80b84cb86c1a41c668202440eb502e40e69fcf88694ac790517a43293a8365b
data/lib/stocks/quote.rb CHANGED
@@ -2,29 +2,31 @@
2
2
  # License:: MIT
3
3
 
4
4
  # Provides an instance of a stock quote.
5
- class Quote < Hash
6
- # Mapping from base_quote type to YahooFinance method of retrieval
7
- TYPES = {
8
- 'extended': :get_extended_quotes,
9
- 'standard': :get_standard_quotes
10
- }
5
+ module Stocks
6
+ class Quote < Hash
7
+ # Mapping from base_quote type to YahooFinance method of retrieval
8
+ TYPES = {
9
+ 'extended': :get_extended_quotes,
10
+ 'standard': :get_standard_quotes
11
+ }
11
12
 
12
- def initialize(base_quote)
13
- @base_quote = base_quote
14
- get_fields.each { |field| self[field] = base_quote.send(field) }
15
- end
13
+ def initialize(base_quote)
14
+ @base_quote = base_quote
15
+ get_fields.each { |field| self[field] = base_quote.send(field) }
16
+ end
16
17
 
17
- private
18
+ private
18
19
 
19
- attr_accessor :base_quote
20
+ attr_accessor :base_quote
20
21
 
21
- # :nodoc:
22
- def get_fields
23
- @base_quote.instance_variables.map { |f|
24
- f.to_s.gsub('@','').to_sym
25
- }.reject { |f_sym|
26
- !@base_quote.public_methods.include?(f_sym)
27
- }
22
+ # :nodoc:
23
+ def get_fields
24
+ @base_quote.instance_variables.map { |f|
25
+ f.to_s.gsub('@','').to_sym
26
+ }.reject { |f_sym|
27
+ !@base_quote.public_methods.include?(f_sym)
28
+ }
29
+ end
28
30
  end
29
31
  end
30
32
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Fornaciari