kandianying 1.0.0 → 1.1.0

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: 3c2b7b9301e9a183bf01b53e8836f917cfaa46b8
4
- data.tar.gz: 7626e72430864d00b07770361aa7a314a18be371
3
+ metadata.gz: 34f5f12b037668581e8409e436b57182d4c95e6a
4
+ data.tar.gz: fe2152abdad80bb67349aa15c7a66224cc0c7c4b
5
5
  SHA512:
6
- metadata.gz: 0a1d8102acecabcf895a6e48fd5448d2107accc01ff2d8e6fd3743a0ba1b64597c760beb5195c8cd25ff35bbe12e83437bf922b65b62196093f6852c6b2dcc93
7
- data.tar.gz: 2632153993af786b284fb34ddfd87104ecec2ea7aa0f985b1fd04c95cc2c2cef18662da6428aac0d03e6fa4011add45f57f52cc790de242954ff6b1576bed89d
6
+ metadata.gz: 8f84c73702e9e86e24226de5cda135faa02e32ef9cd3cbf3d189fbc875e9650436e8a82f44b54d5c902a320c70ef519e2a21815eedf671bcc4397aa829a65168
7
+ data.tar.gz: b065b1d95633ac22db77dc47af8e37cf4e313cb65491b8c24fb89ea265fc4fd7c94a8107b5a729b42f440df25fd686804850cd62fc20368ac0bb201969eda936
@@ -8,20 +8,25 @@ require_relative 'search'
8
8
 
9
9
  # Scraper for Ambassador
10
10
  module Ambassador
11
+ INIT_ERR = 'id out of range'
12
+ LANGUAGE_ERROR = 'language must be one of \'english\' or \'chinese\''
13
+ LANGUAGES = %w(english chinese)
14
+
11
15
  # Class for Vieshow films
12
16
  class Ambassador
13
17
  include AmbassadorScrape, Search
14
18
  attr_reader :movie_table, :theater_id_table, :cinema_name
15
19
 
16
- def initialize(id, language)
20
+ def initialize(id, lang)
17
21
  @movie_table = {}
18
22
  @theater_id_table = fetch_theater_id_table(AMBASSADOR_THEATER_ID_URL)
23
+ fail INIT_ERR unless theater_id_table.keys.any? { |key| key.include? id }
24
+ fail LANGUAGE_ERROR unless LANGUAGES.include? lang
19
25
  theater_id_table.each do |theater_id, theater_name|
20
26
  next unless theater_id.include? id
21
- date_list = fetch_theater_date(theater_id)
27
+ dates = fetch_theater_date(theater_id)
22
28
  @cinema_name = theater_name
23
- @movie_table[theater_name] = fetch_movie_info(theater_id, date_list,
24
- language)
29
+ @movie_table[theater_name] = fetch_movie_info(theater_id, dates, lang)
25
30
  end
26
31
  end
27
32
 
@@ -1,5 +1,5 @@
1
1
  # Versioning
2
2
  module KanDianYing
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  DATE = '2015-11-19'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kandianying
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stonegold546
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.8
181
+ rubygems_version: 2.4.6
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Get movie information in Hsin Chu