centaman 5.0.4 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/centaman/object/extra.rb +3 -1
- data/lib/centaman/object/ticket_type.rb +5 -1
- data/lib/centaman/service/extra.rb +10 -2
- data/lib/centaman/service/ticket_type.rb +10 -2
- data/lib/centaman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3859d3bdf6f59b7de33fefac98a2d5dedc65d0493aca8353a2a87b0c5a740ea8
|
4
|
+
data.tar.gz: 02f33057ced046dab323ae8db5464d8497e351dc2a3fa95027b672489fb3b46d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6a7d09e3a37f41e530a5eb06a7f38648ae219cabbe4e4b971e1b71b0e8e7ac29aa288499cb9dbcef5a23375ef90192a74bc6b951c52f3b5bc2e3b49b882cdc
|
7
|
+
data.tar.gz: d0ca8e4ede5f338f30b8e2f1b816fda40070a3078cb24ddb38b12b0973c5f08f22f83ff1d1741c77eae0a6ccb1aeddbfaf4f3c8803a171850b067428b7e6a148
|
@@ -1,9 +1,11 @@
|
|
1
1
|
module Centaman
|
2
2
|
class Object::Extra < Centaman::Object
|
3
|
+
attr_reader :booking_time_id
|
3
4
|
attr_accessor :quantity
|
4
5
|
|
5
|
-
def after_init(
|
6
|
+
def after_init(args = {})
|
6
7
|
@quantity = 0
|
8
|
+
@booking_time_id = args.fetch(:booking_time_id, nil)
|
7
9
|
end
|
8
10
|
|
9
11
|
def price
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Centaman
|
2
2
|
class Object::TicketType < Centaman::Object
|
3
|
-
attr_reader :price, :discount
|
3
|
+
attr_reader :price, :discount, :booking_time_id
|
4
4
|
attr_accessor :quantity
|
5
5
|
|
6
|
+
def after_init(args)
|
7
|
+
@booking_time_id = args.fetch(:booking_time_id, nil)
|
8
|
+
end
|
9
|
+
|
6
10
|
def price
|
7
11
|
@price ||= begin
|
8
12
|
p = price_including_tax / (1 + tax_percentage / 100)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module Centaman
|
2
2
|
class Service::Extra < Centaman::Service
|
3
3
|
include Centaman::JsonWrapper
|
4
|
-
attr_reader :booking_time_id
|
4
|
+
attr_reader :booking_time_id, :cost_rate_id
|
5
5
|
|
6
6
|
def after_init(args)
|
7
7
|
@booking_time_id = args[:booking_time_id]
|
8
|
+
@cost_rate_id = args[:cost_rate_id]
|
8
9
|
require_args
|
9
10
|
end
|
10
11
|
|
@@ -18,10 +19,17 @@ module Centaman
|
|
18
19
|
|
19
20
|
def options
|
20
21
|
super + [
|
21
|
-
{ key: 'TimedTicketTypeId', value: booking_time_id }
|
22
|
+
{ key: 'TimedTicketTypeId', value: booking_time_id },
|
23
|
+
{ key: 'CostRateId', value: cost_rate_id }
|
22
24
|
]
|
23
25
|
end
|
24
26
|
|
27
|
+
def additional_hash_to_serialize_after_response
|
28
|
+
{
|
29
|
+
booking_time_id: booking_time_id
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
25
33
|
def require_args
|
26
34
|
raise "booking_time_id is required for #{self.class.name}" if booking_time_id.nil?
|
27
35
|
end
|
@@ -3,10 +3,11 @@ module Centaman
|
|
3
3
|
include Centaman::JsonWrapper
|
4
4
|
DISCOUNT = 0.0
|
5
5
|
|
6
|
-
attr_reader :booking_time_id
|
6
|
+
attr_reader :booking_time_id, :cost_rate_id
|
7
7
|
|
8
8
|
def after_init(args)
|
9
9
|
@booking_time_id = args[:booking_time_id]
|
10
|
+
@cost_rate_id = args[:cost_rate_id]
|
10
11
|
require_args
|
11
12
|
end
|
12
13
|
|
@@ -27,10 +28,17 @@ module Centaman
|
|
27
28
|
|
28
29
|
def options
|
29
30
|
super + [
|
30
|
-
{ key:
|
31
|
+
{ key: 'TimedTicketTypeId', value: booking_time_id },
|
32
|
+
{ key: 'CostRateId', value: cost_rate_id }
|
31
33
|
]
|
32
34
|
end
|
33
35
|
|
36
|
+
def additional_hash_to_serialize_after_response
|
37
|
+
{
|
38
|
+
booking_time_id: booking_time_id
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
34
42
|
def objects
|
35
43
|
Rails.env.test? ? build_objects(sample_response) : super
|
36
44
|
end
|
data/lib/centaman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centaman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- francirp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|