captive 1.1.0 → 1.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79a71dcf3548d49781cc44f2d7141d53db3268b22e535ce6d3871a560b2ff416
4
- data.tar.gz: b5e44c915d7c0d16e0cf24a62c053f0526f765c5f7a6aff061e2bbd2666fa848
3
+ metadata.gz: 507732c8b1ccb140a3ad934f6c8fd4e8f05e49703ce9e48b5e07c4cb815ad6b0
4
+ data.tar.gz: f1c314eea9df3e4482e44db07a3ec664da05f7032712a883c7826a23096c8dbf
5
5
  SHA512:
6
- metadata.gz: d407c301e9d7f617bd99fae21c3b45dfd0753a11afb1993a1be500e9f95fab1cdcc8606aef69c826c3cf7c5c981df600933773cb30c9f36f5de84dea0453d6c2
7
- data.tar.gz: 36906e52e3acb139114be27ba7ffd35dd2a0f494580325b10c1fbec3f271b741da32f277ef607080e531449c9c02f6203c61df13e161f73fa0deccca99b8cb1a
6
+ metadata.gz: 1845a4d5314701d636400b753ff609638466151ba24b27edf77a6e670380cbb258388529c788e93d5e3e440c9ab84bd3d9a373d4d7d461343968ba7739834b00
7
+ data.tar.gz: 36f0ba341f0878eb7a2d5cb11fc36feea8182b55754762d308f7073be715ad5af208e89a22562cecad34fc66a183fd4e747e8a6879ea1b7cecf46ae3aa960739
@@ -15,11 +15,12 @@ module Captive
15
15
  new(cue_list: parse(blob: blob))
16
16
  end
17
17
 
18
- def from_json(json:)
18
+ def from_json(json:, mapping: {})
19
19
  json = JSON.parse(json) if json.is_a?(String)
20
- raise InvalidJsonInput unless json.key?('cues') && json['cues'].is_a?(Array)
20
+ cues = json['cues'] || json[:cues]
21
+ raise InvalidJsonInput unless cues.is_a?(Array)
21
22
 
22
- cues = json['cues'].map { |cue_json| Cue.from_json(json: cue_json) }
23
+ cues.map! { |cue_json| Cue.from_json(json: cue_json, mapping: mapping) }
23
24
  new(cue_list: cues)
24
25
  end
25
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Captive
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mserran2