apple-news 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d6c403146c04a7a93ffe92adaa573a15dd9d551
4
- data.tar.gz: 6f82b260da85c323757389ad47d83b843c8967e5
3
+ metadata.gz: 32d92fd8859e0f642080cb1a999a9ba56f203eab
4
+ data.tar.gz: 25cf951c7c4146c42632a43ae3e565c1c69810bb
5
5
  SHA512:
6
- metadata.gz: 1224e897e5dac6d57e17f6c1a022efa778e530f7bd3d794468a4af8453ec590134c6e17aa266da9f596bf263b92ea3916ccacedb0de44f508dd4b39075d38b08
7
- data.tar.gz: 3c2f340b35ad3448708f38800db080b341e2f16053618e8bf8c9b88abf9c46eed8845b79840ad29f2bea8cf5ee4218575e2ad1e7eafedd7bc7f153631dd202eb
6
+ metadata.gz: f4fa765d9ca726e30d88f08e34c00b1e7dc97cca19fa75853827b632bbbfe24bb045fd504696b848ffc992b0ff7d5fc75b4828d46f66059ba70289e2d0b9074b
7
+ data.tar.gz: 3fea399bf9c7c7a535d57e6b2bcd242744dc3ad65510b70bdf775c986bcd387d241553ebcc322b02de6ea9a02d8e5cf0321a8dd6be9c18ce798154daf97548c6
@@ -3,7 +3,7 @@ module AppleNews
3
3
  include Properties
4
4
  optional_properties :authors, :campaign_data, :canonical_url, :date_created,
5
5
  :date_modified, :date_published, :excerpt, :generator_identifier,
6
- :keywords, :thumbnail_url
6
+ :keywords, :thumbnail_url, :video_url
7
7
 
8
8
  optional_property :generator_name, "apple-news-rb"
9
9
  optional_property :generator_version, AppleNews::VERSION
@@ -12,5 +12,6 @@ module AppleNews
12
12
 
13
13
  property_inflection :canonical_url, 'canonicalURL'
14
14
  property_inflection :thumbnail_url, 'thumbnailURL'
15
+ property_inflection :video_url, 'videoURL'
15
16
  end
16
17
  end
@@ -9,9 +9,9 @@ module AppleNews
9
9
  def load_properties(opts)
10
10
  opts = ActiveSupport::HashWithIndifferentAccess.new(opts || {})
11
11
  self.class.properties.each do |prop, settings|
12
- camelized_prop = prop.to_s.camelize(:lower)
12
+ json_key = _property_inflection[prop] || prop.to_s.camelize(:lower)
13
13
  val = if !settings[:klass].nil?
14
- assigned_val = opts.fetch(camelized_prop, settings[:default])
14
+ assigned_val = opts.fetch(json_key, settings[:default])
15
15
 
16
16
  if settings[:default].is_a?(Array)
17
17
  assigned_val.map { |v|
@@ -27,7 +27,7 @@ module AppleNews
27
27
  assigned_val.nil? ? nil : settings[:klass].send(settings[:init_method], assigned_val)
28
28
  end
29
29
  else
30
- opts.fetch(camelized_prop, settings[:default])
30
+ opts.fetch(json_key, settings[:default])
31
31
  end
32
32
 
33
33
  instance_variable_set "@#{prop}", val
@@ -1,3 +1,3 @@
1
1
  module AppleNews
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple-news
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-29 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler