odeon_uk 3.0.3 → 3.0.4

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: 15aeed4e417889439034e9a710d6c423eb3a4208
4
- data.tar.gz: c1911caefb33bec1cdc3b60607f431ae542d642a
3
+ metadata.gz: a93bd99698e1107ba48963d63c856bb30db8fe04
4
+ data.tar.gz: 0f34f24b21b31c018ee33973125cdabd6db51407
5
5
  SHA512:
6
- metadata.gz: a07cc4010b73b47d0381d067876d6814d5cd49ea78b4cf2af3521d3cb2bdab3178f83b29f18d347b0645895951300b8f0e7681f42b59492d688bb69361418168
7
- data.tar.gz: 30860fbccc5fb2b0f3558c2bcbd77802da7b3c46f070ca779aa68b0775bcac8c36fc981aa460df335cbeb37598673d5a2b98faf36ba8ba7146f489c5a2e9e146
6
+ metadata.gz: e457d07343eeac1b78ccbb80f1b1821ac83e11c8e24c6d77e8cf2ab0bffd8b4c724794b787f17f7f291f22e2c41f94baf0b80c226308680835fcfe1a6350b312
7
+ data.tar.gz: d96d6d0229ca9408259d1f798b3fa6ea88430a318cd7f09bc831c5c6154f79a8e95b04def2728ed5cf047dc6e130e809b8722669b461356763a83291cd0afc48
@@ -1,3 +1,8 @@
1
+ ## 3.0.4 - 2015-05-06
2
+
3
+ ### Added
4
+ - URLs created for api cinemas
5
+
1
6
  ## 3.0.3 - 2015-04-09
2
7
 
3
8
  ### Added
@@ -34,6 +34,7 @@ module OdeonUk
34
34
  # The url of the cinema
35
35
  # @return [Nil]
36
36
  def url
37
+ "http://www.odeon.co.uk/cinemas/#{urlized_name}/#{@id}/"
37
38
  end
38
39
 
39
40
  # Post code of the cinema
@@ -57,6 +58,10 @@ module OdeonUk
57
58
  def cinema_hash
58
59
  @cinema_hash ||= self.class.cinemas_hash[id.to_s]
59
60
  end
61
+
62
+ def urlized_name
63
+ name.downcase.gsub(/[^a-z0-9]/, '_')
64
+ end
60
65
  end
61
66
  end
62
67
  end
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for http://www.odeon.co.uk
2
- # @version 3.0.3
2
+ # @version 3.0.4
3
3
  module OdeonUk
4
4
  # Gem version
5
- VERSION = '3.0.3'
5
+ VERSION = '3.0.4'
6
6
  end
@@ -72,7 +72,7 @@ describe OdeonUk::Api::Cinema do
72
72
  end
73
73
  end
74
74
  end
75
-
75
+
76
76
  describe '#locality' do
77
77
  subject { described_class.new(id).locality }
78
78
 
@@ -146,4 +146,20 @@ describe OdeonUk::Api::Cinema do
146
146
  end
147
147
  end
148
148
  end
149
+
150
+ describe '#url' do
151
+ subject { described_class.new(id).url }
152
+
153
+ describe 'short address' do
154
+ let(:id) { 71 }
155
+
156
+ before { response.expect(:all_cinemas, parse(all_cinemas_plist)) }
157
+
158
+ it 'returns first line of address' do
159
+ OdeonUk::Api::Response.stub :new, response do
160
+ subject.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
161
+ end
162
+ end
163
+ end
164
+ end
149
165
  end
@@ -295,7 +295,7 @@ describe OdeonUk::Cinema do
295
295
  subject.brand.must_equal 'Odeon'
296
296
  subject.name.must_equal 'Brighton'
297
297
  subject.slug.must_equal 'odeon-brighton'
298
- subject.url.must_be_nil
298
+ subject.url.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
299
299
  end
300
300
  end
301
301
  end
@@ -472,7 +472,7 @@ describe OdeonUk::Cinema do
472
472
 
473
473
  it 'returns the brand in the name' do
474
474
  OdeonUk::Api::Response.stub :new, response do
475
- subject.must_be_nil
475
+ subject.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
476
476
  end
477
477
  end
478
478
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odeon_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake