cinebase 1.0.1 → 1.1.0

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: 9a4bc0e2e8bc577db2b13fcb1984ccb7ca84a4c9
4
- data.tar.gz: 9046beadea156ef9eb1461bdab17158e647dae3a
3
+ metadata.gz: 9dbe72822b7cee3c4292fe85bdaaa744feba6756
4
+ data.tar.gz: b52d2d5b0edca3fef29bd85f433b9ed083381eda
5
5
  SHA512:
6
- metadata.gz: 656a6a16b184df0e9c135c9ff05bccac66a858a87495409eb60dd9506b8b9693673057fc3fb1e60a1f27bb371cf48762fcae81933992de1d198237379b51a821
7
- data.tar.gz: 2149aa5e55a576437df5db442eb56adc0d09fd68b244e0e35abd11723a90b50b82b9d9e3c683457ac6c230cf1da9b42356896e53602ea6a1928d69dc5d06a532
6
+ metadata.gz: e7b96aa999eccdcd38dab5b3349659989c898d694181ead54288d77ef82a45f7eadef85c8ef4a808a9fce5571c290ae18bb2fc3c3da1a7715dfbf82277484d9a
7
+ data.tar.gz: f5ac98bfde0881ecf4afa852694a79ec68d8d18f86cf7549da379d71b4887e45d1bd30e634ae744b82da9c9e356c113bb882d87b594d7f39472fec9463a29e95
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [1.1.0]
6
+ ### Changed
7
+ - It is expected that the `Cinema#adr` method is redefined on the subclass and
8
+ thus auto-populates the following added methods...
9
+
10
+ ### Added
11
+ - Method `Cinema#street_address` to pull String from `Cinema#adr`
12
+ - Method `Cinema#extended_address` to pull String from `Cinema#adr`
13
+ - Method `Cinema#locality` to pull String from `Cinema#adr`
14
+ - Method `Cinema#region` to pull String from `Cinema#adr`
15
+ - Method `Cinema#postal_code` to pull String from `Cinema#adr`
16
+ - Method `Cinema#country_name` to pull String from `Cinema#adr`
17
+
5
18
  ## [1.0.1]
6
19
  ### Fixed
7
20
  - Implementation of TitleSanitizer no longer creates anonymous `Struct`
@@ -13,28 +13,52 @@ module Cinebase
13
13
 
14
14
  def adr
15
15
  {
16
- street_address: street_address,
17
- extended_address: extended_address,
18
- locality: locality,
19
- postal_code: postal_code,
20
- country_name: country_name
21
- }.reject { |_, v| v.nil? }
16
+ street_address: nil,
17
+ extended_address: nil,
18
+ locality: nil,
19
+ region: nil,
20
+ postal_code: nil,
21
+ country_name: nil
22
+ }
22
23
  end
23
24
  alias_method :address, :adr
24
25
 
25
- [:brand, :country_name, :extended_address, :locality, :name, :postal_code,
26
- :street_address, :url].each do |method|
27
- define_method(method) do
28
- fail NotImplementedError, "This #{self.class} cannot respond to: "
29
- end
26
+ def country_name
27
+ adr[:country_name].to_s
28
+ end
29
+
30
+ def extended_address
31
+ adr[:extended_address].to_s
30
32
  end
31
33
 
32
34
  def full_name
33
35
  @full_name ||= "#{brand} #{name}"
34
36
  end
35
37
 
38
+ def locality
39
+ adr[:locality].to_s
40
+ end
41
+
42
+ def postal_code
43
+ adr[:postal_code].to_s
44
+ end
45
+
46
+ def region
47
+ adr[:region].to_s
48
+ end
49
+
36
50
  def slug
37
51
  @slug ||= full_name.downcase.gsub(/[^0-9a-z ]/, '').gsub(/\s+/, '-')
38
52
  end
53
+
54
+ def street_address
55
+ adr[:street_address].to_s
56
+ end
57
+
58
+ %i(brand name url).each do |method|
59
+ define_method(method) do
60
+ fail NotImplementedError, "This #{self.class} cannot respond to: "
61
+ end
62
+ end
39
63
  end
40
64
  end
@@ -1,4 +1,4 @@
1
1
  # Cinebase version
2
2
  module Cinebase
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-17 00:00:00.000000000 Z
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.5.1
113
+ rubygems_version: 2.4.5
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: A base for cinema parsers to maintain a regular interface.