aylien_news_api 0.3.0 → 0.4.0

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +21 -21
  3. data/aylien_news_api-0.3.0.gem +0 -0
  4. data/aylien_news_api.gemspec +3 -2
  5. data/docs/DefaultApi.md +451 -250
  6. data/docs/Media.md +4 -0
  7. data/lib/aylien_news_api/api/default_api.rb +965 -341
  8. data/lib/aylien_news_api/api_client.rb +13 -5
  9. data/lib/aylien_news_api/configuration.rb +6 -6
  10. data/lib/aylien_news_api/models/author.rb +3 -3
  11. data/lib/aylien_news_api/models/autocomplete.rb +3 -3
  12. data/lib/aylien_news_api/models/autocompletes.rb +3 -3
  13. data/lib/aylien_news_api/models/category.rb +3 -3
  14. data/lib/aylien_news_api/models/category_links.rb +3 -3
  15. data/lib/aylien_news_api/models/coverages.rb +3 -3
  16. data/lib/aylien_news_api/models/entities.rb +3 -3
  17. data/lib/aylien_news_api/models/entity.rb +3 -4
  18. data/lib/aylien_news_api/models/entity_links.rb +3 -3
  19. data/lib/aylien_news_api/models/error.rb +3 -3
  20. data/lib/aylien_news_api/models/error_links.rb +3 -3
  21. data/lib/aylien_news_api/models/errors.rb +3 -3
  22. data/lib/aylien_news_api/models/histogram_interval.rb +3 -3
  23. data/lib/aylien_news_api/models/histograms.rb +3 -3
  24. data/lib/aylien_news_api/models/location.rb +3 -3
  25. data/lib/aylien_news_api/models/media.rb +59 -7
  26. data/lib/aylien_news_api/models/rank.rb +3 -3
  27. data/lib/aylien_news_api/models/rankings.rb +3 -3
  28. data/lib/aylien_news_api/models/related_stories.rb +3 -3
  29. data/lib/aylien_news_api/models/scope.rb +3 -3
  30. data/lib/aylien_news_api/models/sentiment.rb +3 -4
  31. data/lib/aylien_news_api/models/sentiments.rb +3 -3
  32. data/lib/aylien_news_api/models/share_count.rb +3 -3
  33. data/lib/aylien_news_api/models/share_counts.rb +3 -3
  34. data/lib/aylien_news_api/models/source.rb +3 -3
  35. data/lib/aylien_news_api/models/stories.rb +3 -3
  36. data/lib/aylien_news_api/models/story.rb +3 -3
  37. data/lib/aylien_news_api/models/story_cluster.rb +3 -3
  38. data/lib/aylien_news_api/models/story_links.rb +3 -3
  39. data/lib/aylien_news_api/models/summary.rb +3 -3
  40. data/lib/aylien_news_api/models/time_series.rb +3 -3
  41. data/lib/aylien_news_api/models/time_series_list.rb +3 -3
  42. data/lib/aylien_news_api/models/trend.rb +3 -3
  43. data/lib/aylien_news_api/models/trends.rb +3 -3
  44. data/lib/aylien_news_api/version.rb +1 -1
  45. metadata +4 -6
@@ -57,10 +57,18 @@ module AylienNewsApi
57
57
  end
58
58
 
59
59
  unless response.success?
60
- fail ApiError.new(:code => response.code,
61
- :response_headers => response.headers,
62
- :response_body => response.body),
63
- response.status_message
60
+ if response.timed_out?
61
+ fail ApiError.new('Connection timed out')
62
+ elsif response.code == 0
63
+ # Errors from libcurl will be made visible here
64
+ fail ApiError.new(:code => 0,
65
+ :message => response.return_message)
66
+ else
67
+ fail ApiError.new(:code => response.code,
68
+ :response_headers => response.headers,
69
+ :response_body => response.body),
70
+ response.status_message
71
+ end
64
72
  end
65
73
 
66
74
  if opts[:return_type]
@@ -126,7 +134,7 @@ module AylienNewsApi
126
134
  # application/json; charset=UTF8
127
135
  # APPLICATION/JSON
128
136
  # @param [String] mime MIME
129
- # @return [Boolean] True if the MIME is applicaton/json
137
+ # @return [Boolean] True if the MIME is application/json
130
138
  def json_mime?(mime)
131
139
  !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
132
140
  end
@@ -192,19 +192,19 @@ module AylienNewsApi
192
192
  # Returns Auth Settings hash for api client.
193
193
  def auth_settings
194
194
  {
195
- 'app_key' =>
195
+ 'app_id' =>
196
196
  {
197
197
  type: 'api_key',
198
198
  in: 'header',
199
- key: 'X-AYLIEN-NewsAPI-Application-Key',
200
- value: api_key_with_prefix('X-AYLIEN-NewsAPI-Application-Key')
199
+ key: 'X-AYLIEN-NewsAPI-Application-ID',
200
+ value: api_key_with_prefix('X-AYLIEN-NewsAPI-Application-ID')
201
201
  },
202
- 'app_id' =>
202
+ 'app_key' =>
203
203
  {
204
204
  type: 'api_key',
205
205
  in: 'header',
206
- key: 'X-AYLIEN-NewsAPI-Application-ID',
207
- value: api_key_with_prefix('X-AYLIEN-NewsAPI-Application-ID')
206
+ key: 'X-AYLIEN-NewsAPI-Application-Key',
207
+ value: api_key_with_prefix('X-AYLIEN-NewsAPI-Application-Key')
208
208
  },
209
209
  }
210
210
  end
@@ -108,7 +108,7 @@ module AylienNewsApi
108
108
  def build_from_hash(attributes)
109
109
  return nil unless attributes.is_a?(Hash)
110
110
  self.class.api_types.each_pair do |key, type|
111
- if type =~ /^Array<(.*)>/i
111
+ if type =~ /\AArray<(.*)>/i
112
112
  # check to ensure the input is an array given that the the attribute
113
113
  # is documented as an array but the input is not
114
114
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -139,7 +139,7 @@ module AylienNewsApi
139
139
  when :Float
140
140
  value.to_f
141
141
  when :BOOLEAN
142
- if value.to_s =~ /^(true|t|yes|y|1)$/i
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
143
  true
144
144
  else
145
145
  false
@@ -150,7 +150,7 @@ module AylienNewsApi
150
150
  when /\AArray<(?<inner_type>.+)>\z/
151
151
  inner_type = Regexp.last_match[:inner_type]
152
152
  value.map { |v| _deserialize(inner_type, v) }
153
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
154
  k_type = Regexp.last_match[:k_type]
155
155
  v_type = Regexp.last_match[:v_type]
156
156
  {}.tap do |hash|
@@ -98,7 +98,7 @@ module AylienNewsApi
98
98
  def build_from_hash(attributes)
99
99
  return nil unless attributes.is_a?(Hash)
100
100
  self.class.api_types.each_pair do |key, type|
101
- if type =~ /^Array<(.*)>/i
101
+ if type =~ /\AArray<(.*)>/i
102
102
  # check to ensure the input is an array given that the the attribute
103
103
  # is documented as an array but the input is not
104
104
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -129,7 +129,7 @@ module AylienNewsApi
129
129
  when :Float
130
130
  value.to_f
131
131
  when :BOOLEAN
132
- if value.to_s =~ /^(true|t|yes|y|1)$/i
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
133
  true
134
134
  else
135
135
  false
@@ -140,7 +140,7 @@ module AylienNewsApi
140
140
  when /\AArray<(?<inner_type>.+)>\z/
141
141
  inner_type = Regexp.last_match[:inner_type]
142
142
  value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
144
  k_type = Regexp.last_match[:k_type]
145
145
  v_type = Regexp.last_match[:v_type]
146
146
  {}.tap do |hash|
@@ -90,7 +90,7 @@ module AylienNewsApi
90
90
  def build_from_hash(attributes)
91
91
  return nil unless attributes.is_a?(Hash)
92
92
  self.class.api_types.each_pair do |key, type|
93
- if type =~ /^Array<(.*)>/i
93
+ if type =~ /\AArray<(.*)>/i
94
94
  # check to ensure the input is an array given that the the attribute
95
95
  # is documented as an array but the input is not
96
96
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -121,7 +121,7 @@ module AylienNewsApi
121
121
  when :Float
122
122
  value.to_f
123
123
  when :BOOLEAN
124
- if value.to_s =~ /^(true|t|yes|y|1)$/i
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
125
  true
126
126
  else
127
127
  false
@@ -132,7 +132,7 @@ module AylienNewsApi
132
132
  when /\AArray<(?<inner_type>.+)>\z/
133
133
  inner_type = Regexp.last_match[:inner_type]
134
134
  value.map { |v| _deserialize(inner_type, v) }
135
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
135
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
136
136
  k_type = Regexp.last_match[:k_type]
137
137
  v_type = Regexp.last_match[:v_type]
138
138
  {}.tap do |hash|
@@ -171,7 +171,7 @@ module AylienNewsApi
171
171
  def build_from_hash(attributes)
172
172
  return nil unless attributes.is_a?(Hash)
173
173
  self.class.api_types.each_pair do |key, type|
174
- if type =~ /^Array<(.*)>/i
174
+ if type =~ /\AArray<(.*)>/i
175
175
  # check to ensure the input is an array given that the the attribute
176
176
  # is documented as an array but the input is not
177
177
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -202,7 +202,7 @@ module AylienNewsApi
202
202
  when :Float
203
203
  value.to_f
204
204
  when :BOOLEAN
205
- if value.to_s =~ /^(true|t|yes|y|1)$/i
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
206
  true
207
207
  else
208
208
  false
@@ -213,7 +213,7 @@ module AylienNewsApi
213
213
  when /\AArray<(?<inner_type>.+)>\z/
214
214
  inner_type = Regexp.last_match[:inner_type]
215
215
  value.map { |v| _deserialize(inner_type, v) }
216
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
217
  k_type = Regexp.last_match[:k_type]
218
218
  v_type = Regexp.last_match[:v_type]
219
219
  {}.tap do |hash|
@@ -98,7 +98,7 @@ module AylienNewsApi
98
98
  def build_from_hash(attributes)
99
99
  return nil unless attributes.is_a?(Hash)
100
100
  self.class.api_types.each_pair do |key, type|
101
- if type =~ /^Array<(.*)>/i
101
+ if type =~ /\AArray<(.*)>/i
102
102
  # check to ensure the input is an array given that the the attribute
103
103
  # is documented as an array but the input is not
104
104
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -129,7 +129,7 @@ module AylienNewsApi
129
129
  when :Float
130
130
  value.to_f
131
131
  when :BOOLEAN
132
- if value.to_s =~ /^(true|t|yes|y|1)$/i
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
133
  true
134
134
  else
135
135
  false
@@ -140,7 +140,7 @@ module AylienNewsApi
140
140
  when /\AArray<(?<inner_type>.+)>\z/
141
141
  inner_type = Regexp.last_match[:inner_type]
142
142
  value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
144
  k_type = Regexp.last_match[:k_type]
145
145
  v_type = Regexp.last_match[:v_type]
146
146
  {}.tap do |hash|
@@ -142,7 +142,7 @@ module AylienNewsApi
142
142
  def build_from_hash(attributes)
143
143
  return nil unless attributes.is_a?(Hash)
144
144
  self.class.api_types.each_pair do |key, type|
145
- if type =~ /^Array<(.*)>/i
145
+ if type =~ /\AArray<(.*)>/i
146
146
  # check to ensure the input is an array given that the the attribute
147
147
  # is documented as an array but the input is not
148
148
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -173,7 +173,7 @@ module AylienNewsApi
173
173
  when :Float
174
174
  value.to_f
175
175
  when :BOOLEAN
176
- if value.to_s =~ /^(true|t|yes|y|1)$/i
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
177
  true
178
178
  else
179
179
  false
@@ -184,7 +184,7 @@ module AylienNewsApi
184
184
  when /\AArray<(?<inner_type>.+)>\z/
185
185
  inner_type = Regexp.last_match[:inner_type]
186
186
  value.map { |v| _deserialize(inner_type, v) }
187
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
188
  k_type = Regexp.last_match[:k_type]
189
189
  v_type = Regexp.last_match[:v_type]
190
190
  {}.tap do |hash|
@@ -102,7 +102,7 @@ module AylienNewsApi
102
102
  def build_from_hash(attributes)
103
103
  return nil unless attributes.is_a?(Hash)
104
104
  self.class.api_types.each_pair do |key, type|
105
- if type =~ /^Array<(.*)>/i
105
+ if type =~ /\AArray<(.*)>/i
106
106
  # check to ensure the input is an array given that the the attribute
107
107
  # is documented as an array but the input is not
108
108
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -133,7 +133,7 @@ module AylienNewsApi
133
133
  when :Float
134
134
  value.to_f
135
135
  when :BOOLEAN
136
- if value.to_s =~ /^(true|t|yes|y|1)$/i
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
137
  true
138
138
  else
139
139
  false
@@ -144,7 +144,7 @@ module AylienNewsApi
144
144
  when /\AArray<(?<inner_type>.+)>\z/
145
145
  inner_type = Regexp.last_match[:inner_type]
146
146
  value.map { |v| _deserialize(inner_type, v) }
147
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
148
  k_type = Regexp.last_match[:k_type]
149
149
  v_type = Regexp.last_match[:v_type]
150
150
  {}.tap do |hash|
@@ -93,7 +93,6 @@ module AylienNewsApi
93
93
  # @return Array for valid properies with the reasons
94
94
  def list_invalid_properties
95
95
  invalid_properties = Array.new
96
-
97
96
  if !@score.nil? && @score > 1.0
98
97
  invalid_properties.push("invalid value for 'score', must be smaller than or equal to 1.0.")
99
98
  end
@@ -158,7 +157,7 @@ module AylienNewsApi
158
157
  def build_from_hash(attributes)
159
158
  return nil unless attributes.is_a?(Hash)
160
159
  self.class.api_types.each_pair do |key, type|
161
- if type =~ /^Array<(.*)>/i
160
+ if type =~ /\AArray<(.*)>/i
162
161
  # check to ensure the input is an array given that the the attribute
163
162
  # is documented as an array but the input is not
164
163
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -189,7 +188,7 @@ module AylienNewsApi
189
188
  when :Float
190
189
  value.to_f
191
190
  when :BOOLEAN
192
- if value.to_s =~ /^(true|t|yes|y|1)$/i
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
192
  true
194
193
  else
195
194
  false
@@ -200,7 +199,7 @@ module AylienNewsApi
200
199
  when /\AArray<(?<inner_type>.+)>\z/
201
200
  inner_type = Regexp.last_match[:inner_type]
202
201
  value.map { |v| _deserialize(inner_type, v) }
203
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
203
  k_type = Regexp.last_match[:k_type]
205
204
  v_type = Regexp.last_match[:v_type]
206
205
  {}.tap do |hash|
@@ -88,7 +88,7 @@ module AylienNewsApi
88
88
  def build_from_hash(attributes)
89
89
  return nil unless attributes.is_a?(Hash)
90
90
  self.class.api_types.each_pair do |key, type|
91
- if type =~ /^Array<(.*)>/i
91
+ if type =~ /\AArray<(.*)>/i
92
92
  # check to ensure the input is an array given that the the attribute
93
93
  # is documented as an array but the input is not
94
94
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -119,7 +119,7 @@ module AylienNewsApi
119
119
  when :Float
120
120
  value.to_f
121
121
  when :BOOLEAN
122
- if value.to_s =~ /^(true|t|yes|y|1)$/i
122
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
123
  true
124
124
  else
125
125
  false
@@ -130,7 +130,7 @@ module AylienNewsApi
130
130
  when /\AArray<(?<inner_type>.+)>\z/
131
131
  inner_type = Regexp.last_match[:inner_type]
132
132
  value.map { |v| _deserialize(inner_type, v) }
133
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
133
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
134
134
  k_type = Regexp.last_match[:k_type]
135
135
  v_type = Regexp.last_match[:v_type]
136
136
  {}.tap do |hash|
@@ -132,7 +132,7 @@ module AylienNewsApi
132
132
  def build_from_hash(attributes)
133
133
  return nil unless attributes.is_a?(Hash)
134
134
  self.class.api_types.each_pair do |key, type|
135
- if type =~ /^Array<(.*)>/i
135
+ if type =~ /\AArray<(.*)>/i
136
136
  # check to ensure the input is an array given that the the attribute
137
137
  # is documented as an array but the input is not
138
138
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -163,7 +163,7 @@ module AylienNewsApi
163
163
  when :Float
164
164
  value.to_f
165
165
  when :BOOLEAN
166
- if value.to_s =~ /^(true|t|yes|y|1)$/i
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
167
  true
168
168
  else
169
169
  false
@@ -174,7 +174,7 @@ module AylienNewsApi
174
174
  when /\AArray<(?<inner_type>.+)>\z/
175
175
  inner_type = Regexp.last_match[:inner_type]
176
176
  value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
178
  k_type = Regexp.last_match[:k_type]
179
179
  v_type = Regexp.last_match[:v_type]
180
180
  {}.tap do |hash|
@@ -87,7 +87,7 @@ module AylienNewsApi
87
87
  def build_from_hash(attributes)
88
88
  return nil unless attributes.is_a?(Hash)
89
89
  self.class.api_types.each_pair do |key, type|
90
- if type =~ /^Array<(.*)>/i
90
+ if type =~ /\AArray<(.*)>/i
91
91
  # check to ensure the input is an array given that the the attribute
92
92
  # is documented as an array but the input is not
93
93
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -118,7 +118,7 @@ module AylienNewsApi
118
118
  when :Float
119
119
  value.to_f
120
120
  when :BOOLEAN
121
- if value.to_s =~ /^(true|t|yes|y|1)$/i
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
122
  true
123
123
  else
124
124
  false
@@ -129,7 +129,7 @@ module AylienNewsApi
129
129
  when /\AArray<(?<inner_type>.+)>\z/
130
130
  inner_type = Regexp.last_match[:inner_type]
131
131
  value.map { |v| _deserialize(inner_type, v) }
132
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
133
  k_type = Regexp.last_match[:k_type]
134
134
  v_type = Regexp.last_match[:v_type]
135
135
  {}.tap do |hash|
@@ -89,7 +89,7 @@ module AylienNewsApi
89
89
  def build_from_hash(attributes)
90
90
  return nil unless attributes.is_a?(Hash)
91
91
  self.class.api_types.each_pair do |key, type|
92
- if type =~ /^Array<(.*)>/i
92
+ if type =~ /\AArray<(.*)>/i
93
93
  # check to ensure the input is an array given that the the attribute
94
94
  # is documented as an array but the input is not
95
95
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -120,7 +120,7 @@ module AylienNewsApi
120
120
  when :Float
121
121
  value.to_f
122
122
  when :BOOLEAN
123
- if value.to_s =~ /^(true|t|yes|y|1)$/i
123
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
124
124
  true
125
125
  else
126
126
  false
@@ -131,7 +131,7 @@ module AylienNewsApi
131
131
  when /\AArray<(?<inner_type>.+)>\z/
132
132
  inner_type = Regexp.last_match[:inner_type]
133
133
  value.map { |v| _deserialize(inner_type, v) }
134
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
135
  k_type = Regexp.last_match[:k_type]
136
136
  v_type = Regexp.last_match[:v_type]
137
137
  {}.tap do |hash|
@@ -98,7 +98,7 @@ module AylienNewsApi
98
98
  def build_from_hash(attributes)
99
99
  return nil unless attributes.is_a?(Hash)
100
100
  self.class.api_types.each_pair do |key, type|
101
- if type =~ /^Array<(.*)>/i
101
+ if type =~ /\AArray<(.*)>/i
102
102
  # check to ensure the input is an array given that the the attribute
103
103
  # is documented as an array but the input is not
104
104
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -129,7 +129,7 @@ module AylienNewsApi
129
129
  when :Float
130
130
  value.to_f
131
131
  when :BOOLEAN
132
- if value.to_s =~ /^(true|t|yes|y|1)$/i
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
133
  true
134
134
  else
135
135
  false
@@ -140,7 +140,7 @@ module AylienNewsApi
140
140
  when /\AArray<(?<inner_type>.+)>\z/
141
141
  inner_type = Regexp.last_match[:inner_type]
142
142
  value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
144
  k_type = Regexp.last_match[:k_type]
145
145
  v_type = Regexp.last_match[:v_type]
146
146
  {}.tap do |hash|
@@ -129,7 +129,7 @@ module AylienNewsApi
129
129
  def build_from_hash(attributes)
130
130
  return nil unless attributes.is_a?(Hash)
131
131
  self.class.api_types.each_pair do |key, type|
132
- if type =~ /^Array<(.*)>/i
132
+ if type =~ /\AArray<(.*)>/i
133
133
  # check to ensure the input is an array given that the the attribute
134
134
  # is documented as an array but the input is not
135
135
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -160,7 +160,7 @@ module AylienNewsApi
160
160
  when :Float
161
161
  value.to_f
162
162
  when :BOOLEAN
163
- if value.to_s =~ /^(true|t|yes|y|1)$/i
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
164
  true
165
165
  else
166
166
  false
@@ -171,7 +171,7 @@ module AylienNewsApi
171
171
  when /\AArray<(?<inner_type>.+)>\z/
172
172
  inner_type = Regexp.last_match[:inner_type]
173
173
  value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
175
  k_type = Regexp.last_match[:k_type]
176
176
  v_type = Regexp.last_match[:v_type]
177
177
  {}.tap do |hash|
@@ -108,7 +108,7 @@ module AylienNewsApi
108
108
  def build_from_hash(attributes)
109
109
  return nil unless attributes.is_a?(Hash)
110
110
  self.class.api_types.each_pair do |key, type|
111
- if type =~ /^Array<(.*)>/i
111
+ if type =~ /\AArray<(.*)>/i
112
112
  # check to ensure the input is an array given that the the attribute
113
113
  # is documented as an array but the input is not
114
114
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -139,7 +139,7 @@ module AylienNewsApi
139
139
  when :Float
140
140
  value.to_f
141
141
  when :BOOLEAN
142
- if value.to_s =~ /^(true|t|yes|y|1)$/i
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
143
  true
144
144
  else
145
145
  false
@@ -150,7 +150,7 @@ module AylienNewsApi
150
150
  when /\AArray<(?<inner_type>.+)>\z/
151
151
  inner_type = Regexp.last_match[:inner_type]
152
152
  value.map { |v| _deserialize(inner_type, v) }
153
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
154
  k_type = Regexp.last_match[:k_type]
155
155
  v_type = Regexp.last_match[:v_type]
156
156
  {}.tap do |hash|