movlog 0.3.10 → 0.3.11

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: 12e0b3e355255228f25a5ae9fabdba417917523b
4
- data.tar.gz: cc53fc87c1eb25661d84fc8ac849d5db36634cd4
3
+ metadata.gz: a18112f93fdd2039c1bb75215bf6f0bc9f122c49
4
+ data.tar.gz: 6cf688097be74ba795bd16d1f35b4de06759bc04
5
5
  SHA512:
6
- metadata.gz: c61635b688d714a863311fb24d1ea787a9af3423626a31c60bce60bbd40da69ec512a28bd487a5cc87537c9935834e768fd0839bf08dd2cebf3e122a5dc1d89d
7
- data.tar.gz: 1d4cd07eded463917c9c30a2ff7518b0f40b75d7dbff523048d2c6ca351053f4f1da423f203c3bfcf85e5104de6d0e1013e33336f77ba98355e625e97681755e
6
+ metadata.gz: c2f69598607c1c483f82842894d7256102fe5c0b04858f2689ac3b5e7cd016af3e35322126476c7f4d89f6981011050b33f15c48aadaf764dc207c47c7afac83
7
+ data.tar.gz: e432e294ea6ac9276e85d88810e8ef2db967539eade4259bc415acbee04fbcd726918e1673469781b455c1d7feaa2403be4d7ef5e0c0894f0487817f26f981f3
@@ -20,8 +20,12 @@ module Skyscanner
20
20
  new(data)
21
21
  end
22
22
 
23
+ def to_hash
24
+ { meta: @meta.to_hash, flights: @flights.to_hash }.to_json
25
+ end
26
+
23
27
  def to_json
24
- { meta: @meta.to_json, flights: @flights.to_json }.to_json
28
+ to_hash.to_json
25
29
  end
26
30
  end
27
31
 
@@ -39,10 +43,10 @@ module Skyscanner
39
43
  @date = data[:date]
40
44
  end
41
45
 
42
- def to_json
46
+ def to_hash
43
47
  { min_price: @min_price, direct: @direct, carriers: @carriers,
44
- origin: @origin.to_json, destination: @destination.to_json,
45
- date: @date }.to_json
48
+ origin: @origin.to_hash, destination: @destination.to_hash,
49
+ date: @date }
46
50
  end
47
51
 
48
52
  end
@@ -63,9 +67,9 @@ module Skyscanner
63
67
  new(data)
64
68
  end
65
69
 
66
- def to_json
70
+ def to_hash
67
71
  { name: @name, city_name: @city_name, country_name: @country_name,
68
- type: @type }.to_json
72
+ type: @type }
69
73
  end
70
74
  end
71
75
  end
@@ -63,7 +63,7 @@ module Skyscanner
63
63
  carrier_ids.map { |cid| @carriers[cid] }
64
64
  end
65
65
  end
66
-
66
+
67
67
  # Query parameters
68
68
  class RouteMeta
69
69
  attr_reader :market, :currency, :locale
@@ -76,6 +76,12 @@ module Skyscanner
76
76
  load_date(data['outbound'], data['inbound'])
77
77
  end
78
78
 
79
+ def to_hash
80
+ { market: @market, currency: @currency, locale: @locale,
81
+ origin: @origin, destination: @destination,
82
+ outbound: @outbound, inbound: @inbound }
83
+ end
84
+
79
85
  private
80
86
 
81
87
  def load_env_data(market, currency, locale)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Movlog
4
- VERSION = '0.3.10'
4
+ VERSION = '0.3.11'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: movlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Wen