hotel_beds 0.6.2 → 0.6.3

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
  SHA1:
3
- metadata.gz: cd7ca89c96613c5ff93444ac446082c051ab4c75
4
- data.tar.gz: 212d402526f959df8ba56120011ef9a1b38f49bb
3
+ metadata.gz: 808ff53e33e9419c831a9386a3a3de32524cd8bc
4
+ data.tar.gz: a3ebc1d3a7562a1a666e5d9e5794fb554b3ee5db
5
5
  SHA512:
6
- metadata.gz: 0bbb6cd3e5f7e6b80b9d4577c04f9f90fee5f5a9d032a8e09d57c5438bebd5044e2f190afe36fd780ab7bf46539c8f49a12d89940d6105bf429136c01f1807b9
7
- data.tar.gz: 0cfe539340a14286ecf63aaf0e2d94e14b617f7bec48b937db3ffa1af4f994758ac8e03fe12e76d1df4e4bb82084d6dbb79e184ee33899bb473545656ec588f7
6
+ metadata.gz: f3ef15c5a78df619616ca2d60dca58e1ae4a5379b7bcf3fae88a11a7098943ebd8bc829846fb0ee5ac0f82e491ab5d26a7b0a601f362f15cb4f464306a841c9a
7
+ data.tar.gz: f0a4b76272bd107eae12c04b4eb3ddfd40cc9e359ebfe66fa7eb34acbea854c786f85e302134552ef0db2b8abc97cea7cf2170c64b8cd83b7c3752fd05827920
@@ -8,6 +8,7 @@ module HotelBeds
8
8
  # attributes
9
9
  attribute :amount, BigDecimal
10
10
  attribute :from, Time
11
+ attribute :to, Time
11
12
  end
12
13
  end
13
14
  end
@@ -6,8 +6,27 @@ module HotelBeds
6
6
  include HotelBeds::Parser
7
7
 
8
8
  # attributes
9
- attribute :amount, attr: "amount"
10
- attribute :from, attr: "dateFrom"
9
+ attribute :amount, selector: "Price > Amount"
10
+ attribute :from do |doc|
11
+ el = doc.at_css("DateTimeFrom")
12
+ v, year, month, day = *el.attr("date").match(/^(\d{4})(\d{2})(\d{2})$/)
13
+ if el.attr("time")
14
+ v, hour, minute = *el.attr("time").match(/^(\d{2})(\d{2})$/)
15
+ else
16
+ hour, minute = 0, 0
17
+ end
18
+ Time.new(year, month, day, hour, minute)
19
+ end
20
+ attribute :to do |doc|
21
+ el = doc.at_css("DateTimeTo")
22
+ v, year, month, day = *el.attr("date").match(/^(\d{4})(\d{2})(\d{2})$/)
23
+ if el.attr("time")
24
+ v, hour, minute = *el.attr("time").match(/^(\d{2})(\d{2})$/)
25
+ else
26
+ hour, minute = 23, 59
27
+ end
28
+ Time.new(year, month, day, hour, minute)
29
+ end
11
30
  end
12
31
  end
13
32
  end
@@ -1,3 +1,3 @@
1
1
  module HotelBeds
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotel_beds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Townsend