quandl_client 2.7.11 → 2.7.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -7
- data/.rspec +1 -1
- data/.travis.yml +20 -20
- data/.yardopts +2 -2
- data/Gemfile +12 -12
- data/Guardfile +8 -8
- data/LICENSE +7 -7
- data/README.md +303 -303
- data/Rakefile +31 -31
- data/UPGRADE.md +220 -214
- data/VERSION +1 -1
- data/examples/create.rb +32 -32
- data/examples/find.rb +17 -17
- data/examples/login.rb +12 -12
- data/examples/search.rb +12 -12
- data/examples/trims.rb +15 -15
- data/lib/quandl/client/base/attributes.rb +15 -15
- data/lib/quandl/client/base/model.rb +40 -40
- data/lib/quandl/client/base/search.rb +74 -74
- data/lib/quandl/client/base/validation.rb +103 -101
- data/lib/quandl/client/base.rb +91 -91
- data/lib/quandl/client/middleware/parse_json.rb +87 -85
- data/lib/quandl/client/middleware.rb +9 -9
- data/lib/quandl/client/models/dataset/data.rb +57 -57
- data/lib/quandl/client/models/dataset.rb +269 -269
- data/lib/quandl/client/models/location.rb +10 -10
- data/lib/quandl/client/models/report.rb +14 -14
- data/lib/quandl/client/models/scraper.rb +16 -16
- data/lib/quandl/client/models/sheet.rb +50 -50
- data/lib/quandl/client/models/source.rb +48 -48
- data/lib/quandl/client/models/superset.rb +65 -65
- data/lib/quandl/client/models/user.rb +7 -7
- data/lib/quandl/client/version.rb +14 -14
- data/lib/quandl/client.rb +54 -53
- data/lib/quandl/her/collection.rb +18 -0
- data/lib/quandl/her/remove_method_data.rb +8 -8
- data/lib/quandl/pattern/client.rb +8 -8
- data/lib/quandl/pattern.rb +37 -37
- data/quandl_client.gemspec +33 -33
- data/spec/factories/dataset.rb +10 -10
- data/spec/factories/sheet.rb +7 -7
- data/spec/factories/source.rb +9 -9
- data/spec/fixtures/scraper.rb +5 -5
- data/spec/lib/quandl/client/dataset/attributes_spec.rb +63 -63
- data/spec/lib/quandl/client/dataset/data_spec.rb +92 -92
- data/spec/lib/quandl/client/dataset/location_spec.rb +65 -65
- data/spec/lib/quandl/client/dataset/persistence_spec.rb +104 -104
- data/spec/lib/quandl/client/dataset/search_spec.rb +19 -19
- data/spec/lib/quandl/client/dataset/source_spec.rb +47 -47
- data/spec/lib/quandl/client/dataset/trim_spec.rb +35 -35
- data/spec/lib/quandl/client/dataset/validation_spec.rb +68 -68
- data/spec/lib/quandl/client/dataset_spec.rb +57 -57
- data/spec/lib/quandl/client/scraper_spec.rb +71 -71
- data/spec/lib/quandl/client/sheet_spec.rb +37 -37
- data/spec/lib/quandl/client/source_spec.rb +51 -51
- data/spec/spec_helper.rb +30 -30
- metadata +28 -4
data/UPGRADE.md
CHANGED
@@ -1,215 +1,221 @@
|
|
1
|
-
## 2.7.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
* QUGC-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
## 2.7.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
## 2.7.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
## 2.7.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
## 2.6.
|
45
|
-
|
46
|
-
* QUGC-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
* QUGC-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
*
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
*
|
67
|
-
|
68
|
-
|
69
|
-
## 2.5.
|
70
|
-
|
71
|
-
*
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
*
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
*
|
95
|
-
*
|
96
|
-
|
97
|
-
|
98
|
-
## 2.4.
|
99
|
-
|
100
|
-
*
|
101
|
-
*
|
102
|
-
|
103
|
-
|
104
|
-
## 2.4.
|
105
|
-
|
106
|
-
*
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
*
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
*
|
128
|
-
*
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
*
|
135
|
-
* add
|
136
|
-
|
137
|
-
|
138
|
-
## 2.3.
|
139
|
-
|
140
|
-
*
|
141
|
-
* add
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
*
|
150
|
-
*
|
151
|
-
|
152
|
-
|
153
|
-
## 2.2.
|
154
|
-
|
155
|
-
*
|
156
|
-
* Dataset.
|
157
|
-
|
158
|
-
|
159
|
-
## 2.
|
160
|
-
|
161
|
-
* add specs for Dataset.query
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
## 2.1.
|
166
|
-
|
167
|
-
* add specs for
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
## 2.1.
|
172
|
-
|
173
|
-
*
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
*
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
1
|
+
## 2.7.12
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
## 2.7.10
|
8
|
+
* QUGC-168 can pass request_platform
|
9
|
+
|
10
|
+
|
11
|
+
## 2.7.9
|
12
|
+
|
13
|
+
* QUGC-164 also search by code
|
14
|
+
* QUGC-164 find by id or source_code/code, or build
|
15
|
+
* QUGC-164 attributes slice needs to ensure that keys are symbols
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
## 2.7.8
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## 2.7.7
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
## 2.7.6
|
32
|
+
|
33
|
+
* QUGC-140 if a source_code is given but does not exist, it should warn the user
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
## 2.7.5
|
38
|
+
add 'at' option for scraper scheduling
|
39
|
+
|
40
|
+
## 2.7.4
|
41
|
+
full url bug fixed when "api" has no / at the end
|
42
|
+
|
43
|
+
|
44
|
+
## 2.6.2
|
45
|
+
|
46
|
+
* QUGC-55 Add Report for filing reports
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
## 2.6.1
|
51
|
+
|
52
|
+
* QUGC-113 fix Dataset#data errors dont propagate to parent object
|
53
|
+
* QUGC-113 Write failing specs for Dataset#data errors dont propagate to parent object
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
## 2.6.0
|
58
|
+
|
59
|
+
* QUGC-104 Fixes when upload fails output is not json
|
60
|
+
* QUGC-103 Fixes quandl upload test -F json does not include metadata
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
## 2.5.2
|
65
|
+
|
66
|
+
* WIKI-153 Add scrapers
|
67
|
+
|
68
|
+
|
69
|
+
## 2.5.1
|
70
|
+
|
71
|
+
* QUGC-57 move data validation from Quandl::Format into Quandl::Client. Data validations only run on #valid?
|
72
|
+
* QUGC-53 numeric codes require the full code
|
73
|
+
|
74
|
+
|
75
|
+
## 2.5.0
|
76
|
+
|
77
|
+
* remove yajl
|
78
|
+
|
79
|
+
|
80
|
+
## 2.4.9
|
81
|
+
|
82
|
+
* observe ruby platform
|
83
|
+
|
84
|
+
|
85
|
+
## 2.4.7
|
86
|
+
|
87
|
+
* add middleware to track the origin of requests across quandl packages
|
88
|
+
|
89
|
+
|
90
|
+
## 2.4.6
|
91
|
+
|
92
|
+
* QUGC-43 improved message on wrong number of colums
|
93
|
+
* QUGC-41 enforce code formatting. always upcase codes
|
94
|
+
* improved example of valid code
|
95
|
+
* revise code pattern
|
96
|
+
|
97
|
+
|
98
|
+
## 2.4.5
|
99
|
+
|
100
|
+
* QUGC-40 add validation to enforce: You may not change number of columns in a dataset
|
101
|
+
* QUGC-37 Dataest.find accept backslash or forward slash interchangeably
|
102
|
+
|
103
|
+
|
104
|
+
## 2.4.4
|
105
|
+
|
106
|
+
* Dataset#data to_table assigns column_names to headers
|
107
|
+
* add skip_browse to Sheet
|
108
|
+
|
109
|
+
|
110
|
+
## 2.4.3
|
111
|
+
|
112
|
+
* hotfix for full_code pattern matching ... code can be as short as two characters
|
113
|
+
|
114
|
+
|
115
|
+
## 2.4.2
|
116
|
+
|
117
|
+
* Dataset.find will return nil unless the id is an integer, or matches the quandl pattern for full_code
|
118
|
+
|
119
|
+
|
120
|
+
## 2.4.1
|
121
|
+
|
122
|
+
* revise reference_url http prepend
|
123
|
+
|
124
|
+
|
125
|
+
## 2.4.0
|
126
|
+
|
127
|
+
* Dataset#reference_url should prepend of http:// when missing
|
128
|
+
* add Quandl::Pattern for defining regex patterns with embedded examples
|
129
|
+
|
130
|
+
|
131
|
+
# 2.3.2
|
132
|
+
|
133
|
+
* add #elapsed_request_time_ms
|
134
|
+
* refactor save_time to request_time. Add specs to #destroy for request_started_at, finished_at, elapsed_request_time
|
135
|
+
* add Client::Base#save_started_at, #save_finished_at, #elapsed_save_time. before_save :touch_save_started_at, after_save :touch_save_finished_at
|
136
|
+
|
137
|
+
|
138
|
+
## 2.3.1
|
139
|
+
|
140
|
+
* bump quandl_data
|
141
|
+
* add human_error_messsages
|
142
|
+
|
143
|
+
|
144
|
+
## 2.3.0
|
145
|
+
|
146
|
+
* add auth_token attribute to user
|
147
|
+
* add Quandl::Client::User, .login for authenticating
|
148
|
+
* full_url outputs the quandl link instead of the api link. Add human_status and HTTP_STATUS_CODES
|
149
|
+
* should validate display_url as a url
|
150
|
+
* add reference_url alias for display_url. reference_url will automatically add http when missing
|
151
|
+
|
152
|
+
|
153
|
+
## 2.2.1
|
154
|
+
|
155
|
+
* full_code: dont assume that source_code is present
|
156
|
+
* Dataset#data scope is cached to permit building across multiple lines. add Dataset#reload to wipe data_scope, dataset_data
|
157
|
+
|
158
|
+
|
159
|
+
## 2.2.0
|
160
|
+
|
161
|
+
* add specs for Dataset.query
|
162
|
+
* Dataset.query.all.metadata should pass
|
163
|
+
|
164
|
+
|
165
|
+
## 2.1.4
|
166
|
+
|
167
|
+
* add specs for Dataset.query(term).all; make specs pass
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
## 2.1.3
|
172
|
+
|
173
|
+
* add specs for data scopes
|
174
|
+
* fix failing data scope specs
|
175
|
+
|
176
|
+
|
177
|
+
## 2.1.2
|
178
|
+
|
179
|
+
* bump quandl_data, operation, logger
|
180
|
+
|
181
|
+
|
182
|
+
## 2.0.1
|
183
|
+
|
184
|
+
* fully qualified classes to avoid collisions
|
185
|
+
|
186
|
+
## 2.0.0
|
187
|
+
|
188
|
+
* update client to take advantage of new /api/v2 routes
|
189
|
+
|
190
|
+
## 0.1.17
|
191
|
+
|
192
|
+
* Dataset#source_code is optional
|
193
|
+
|
194
|
+
|
195
|
+
## 0.1.16
|
196
|
+
|
197
|
+
* add sheet description
|
198
|
+
|
199
|
+
## 0.1.15
|
200
|
+
|
201
|
+
* revise parse_json to respond with more informative error
|
202
|
+
* validation errors should return 422
|
203
|
+
|
204
|
+
## 0.1.14
|
205
|
+
|
206
|
+
* add Dataset#locations spec to test that location data is returned in the same order as it is sent.
|
207
|
+
|
208
|
+
## 0.1.12
|
209
|
+
|
210
|
+
* fix undefined error method
|
211
|
+
|
212
|
+
## 0.1.11
|
213
|
+
|
214
|
+
* add spec for Dataset#availability_delay
|
215
|
+
* add present?, exists?, blank? that check against response status.
|
216
|
+
* remove erroneous source_code and code validations.
|
217
|
+
|
218
|
+
|
219
|
+
## 0.1.10
|
220
|
+
|
215
221
|
* Add Dataset#availability_delay
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.12
|
data/examples/create.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
# load quandl api client
|
4
|
-
require "quandl/client"
|
5
|
-
|
6
|
-
# tools for debugging
|
7
|
-
require "quandl/fabricate"
|
8
|
-
require 'securerandom'
|
9
|
-
require 'pry'
|
10
|
-
|
11
|
-
# Make Dataset available in global namespace
|
12
|
-
include Quandl::Client
|
13
|
-
|
14
|
-
# configure quandl client
|
15
|
-
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
16
|
-
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
17
|
-
|
18
|
-
# set some attributes
|
19
|
-
d = Dataset.new(
|
20
|
-
code: "MY_DATASET_#{Time.now.to_i.to_s(16)}",
|
21
|
-
name: "My dataset has a name.",
|
22
|
-
description: "This is the description.",
|
23
|
-
data: [[ 2014, 1, 2 ]]
|
24
|
-
)
|
25
|
-
# POST to server
|
26
|
-
d.save
|
27
|
-
|
28
|
-
if d.saved?
|
29
|
-
puts "View your new dataset at: #{d.full_url}"
|
30
|
-
else
|
31
|
-
puts "Something went wrong:\n#{d.human_status}\n#{d.human_error_messages}"
|
32
|
-
end
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
# load quandl api client
|
4
|
+
require "quandl/client"
|
5
|
+
|
6
|
+
# tools for debugging
|
7
|
+
require "quandl/fabricate"
|
8
|
+
require 'securerandom'
|
9
|
+
require 'pry'
|
10
|
+
|
11
|
+
# Make Dataset available in global namespace
|
12
|
+
include Quandl::Client
|
13
|
+
|
14
|
+
# configure quandl client
|
15
|
+
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
16
|
+
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
17
|
+
|
18
|
+
# set some attributes
|
19
|
+
d = Dataset.new(
|
20
|
+
code: "MY_DATASET_#{Time.now.to_i.to_s(16)}",
|
21
|
+
name: "My dataset has a name.",
|
22
|
+
description: "This is the description.",
|
23
|
+
data: [[ 2014, 1, 2 ]]
|
24
|
+
)
|
25
|
+
# POST to server
|
26
|
+
d.save
|
27
|
+
|
28
|
+
if d.saved?
|
29
|
+
puts "View your new dataset at: #{d.full_url}"
|
30
|
+
else
|
31
|
+
puts "Something went wrong:\n#{d.human_status}\n#{d.human_error_messages}"
|
32
|
+
end
|
data/examples/find.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
# DEBUGGING
|
4
|
-
require 'pry'
|
5
|
-
require "quandl/fabricate"
|
6
|
-
|
7
|
-
# LOAD
|
8
|
-
require "quandl/client"
|
9
|
-
include Quandl::Client
|
10
|
-
|
11
|
-
# CONFIGURE
|
12
|
-
Quandl::Client.use ENV['QUANDL_URL']
|
13
|
-
Quandl::Client.token = ENV['QUANDL_TOKEN']
|
14
|
-
|
15
|
-
# FIND
|
16
|
-
d = Dataset.find('MCX.ALMG2014')
|
17
|
-
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
# DEBUGGING
|
4
|
+
require 'pry'
|
5
|
+
require "quandl/fabricate"
|
6
|
+
|
7
|
+
# LOAD
|
8
|
+
require "quandl/client"
|
9
|
+
include Quandl::Client
|
10
|
+
|
11
|
+
# CONFIGURE
|
12
|
+
Quandl::Client.use ENV['QUANDL_URL']
|
13
|
+
Quandl::Client.token = ENV['QUANDL_TOKEN']
|
14
|
+
|
15
|
+
# FIND
|
16
|
+
d = Dataset.find('MCX.ALMG2014')
|
17
|
+
|
18
18
|
binding.pry
|
data/examples/login.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
require 'pry'
|
4
|
-
require "quandl/client"
|
5
|
-
|
6
|
-
include Quandl::Client
|
7
|
-
|
8
|
-
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
9
|
-
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
-
|
11
|
-
u = User.login( login: 'blakehil', password: 'example' )
|
12
|
-
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
require 'pry'
|
4
|
+
require "quandl/client"
|
5
|
+
|
6
|
+
include Quandl::Client
|
7
|
+
|
8
|
+
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
9
|
+
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
+
|
11
|
+
u = User.login( login: 'blakehil', password: 'example' )
|
12
|
+
|
13
13
|
binding.pry
|
data/examples/search.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
require 'pry'
|
4
|
-
require "quandl/client"
|
5
|
-
|
6
|
-
include Quandl::Client
|
7
|
-
|
8
|
-
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
9
|
-
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
-
|
11
|
-
datasets = Dataset.query('water').all
|
12
|
-
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
require 'pry'
|
4
|
+
require "quandl/client"
|
5
|
+
|
6
|
+
include Quandl::Client
|
7
|
+
|
8
|
+
Quandl::Client.use ENV['QUANDL_TEST_URL']
|
9
|
+
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
+
|
11
|
+
datasets = Dataset.query('water').all
|
12
|
+
|
13
13
|
binding.pry
|
data/examples/trims.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
-
|
3
|
-
require 'pry'
|
4
|
-
require "quandl/client"
|
5
|
-
|
6
|
-
include Quandl::Client
|
7
|
-
|
8
|
-
Quandl::Client.use 'http://quandl.com/api/'
|
9
|
-
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
-
|
11
|
-
# create dataset
|
12
|
-
d = Dataset.find('NSE/OIL')
|
13
|
-
|
14
|
-
data = d.data.trim_start( 3.weeks.ago ).limit(10)
|
15
|
-
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
2
|
+
|
3
|
+
require 'pry'
|
4
|
+
require "quandl/client"
|
5
|
+
|
6
|
+
include Quandl::Client
|
7
|
+
|
8
|
+
Quandl::Client.use 'http://quandl.com/api/'
|
9
|
+
Quandl::Client.token = ENV['QUANDL_TEST_TOKEN']
|
10
|
+
|
11
|
+
# create dataset
|
12
|
+
d = Dataset.find('NSE/OIL')
|
13
|
+
|
14
|
+
data = d.data.trim_start( 3.weeks.ago ).limit(10)
|
15
|
+
|
16
16
|
binding.pry
|
@@ -1,16 +1,16 @@
|
|
1
|
-
class Quandl::Client::Base
|
2
|
-
module Attributes
|
3
|
-
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
def write_attribute(attribute, value)
|
7
|
-
self.send(:"#{attribute}_will_change!") if @attributes[:"#{attribute}"] != value
|
8
|
-
@attributes[:"#{attribute}"] = value
|
9
|
-
end
|
10
|
-
|
11
|
-
def read_attribute(attribute)
|
12
|
-
@attributes[:"#{attribute}"]
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
1
|
+
class Quandl::Client::Base
|
2
|
+
module Attributes
|
3
|
+
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
def write_attribute(attribute, value)
|
7
|
+
self.send(:"#{attribute}_will_change!") if @attributes[:"#{attribute}"] != value
|
8
|
+
@attributes[:"#{attribute}"] = value
|
9
|
+
end
|
10
|
+
|
11
|
+
def read_attribute(attribute)
|
12
|
+
@attributes[:"#{attribute}"]
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
16
|
end
|