jishan_fast_track_gem 0.1.7 → 0.1.8
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 +4 -4
- data/lib/eligibility_check.rb +26 -15
- data/lib/files_check.rb +5 -5
- data/lib/jishan_fast_track_gem.rb +17 -20
- data/lib/jishan_fast_track_gem/version.rb +1 -1
- data/lib/manage_lists.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f32226133848f91f9a4fb703fc0ba6d36c0ce139268b8ca02607843a1bbca85e
|
4
|
+
data.tar.gz: 02476d1b39041fd5d32ed969220bbb25adcbc9fed76d91ff438da8642ba58a33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db954cb8e4a3ea37b6c55febdc105da497a836f9532713e5d3e26d46d1fe35f971eac00c844a1d79c303f3eb0dc1bdfafeeb371eac1b37545f85b26094cc5185
|
7
|
+
data.tar.gz: f4eb90d5e47282dc0874dda094544f95306528e140ff2836169b34e038fec157315eb8551f44e868de83d5221e4ac2717b51a7e60f6db3d4ad46091bf829b4d9
|
data/lib/eligibility_check.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'csv'
|
3
3
|
require 'colorize'
|
4
|
+
require 'gemoji'
|
4
5
|
|
5
6
|
|
6
7
|
class Solar_panel_rebate_egilibility_check
|
7
|
-
def initialize
|
8
|
-
@
|
8
|
+
def initialize
|
9
|
+
@answers =[]
|
9
10
|
end
|
10
11
|
|
11
12
|
def ower_of_the_property
|
12
13
|
puts "Are you the property owner and the current occupier?".colorize(:light_blue)
|
13
14
|
puts "1. Yes 2. No".colorize(:light_blue)
|
14
15
|
answer = gets.chomp.to_i
|
15
|
-
return unless answer_check(answer)
|
16
|
+
return ower_of_the_property unless answer_check(answer)
|
16
17
|
received_solar_rebate_before
|
17
18
|
end
|
18
19
|
|
@@ -20,7 +21,7 @@ class Solar_panel_rebate_egilibility_check
|
|
20
21
|
puts "Is this your first apply for solar panel rebate?".colorize(:light_blue)
|
21
22
|
puts "1. Yes 2. No".colorize(:light_blue)
|
22
23
|
answer = gets.chomp.to_i
|
23
|
-
return unless answer_check(answer)
|
24
|
+
return received_solar_rebate_before unless answer_check(answer)
|
24
25
|
existed_solar_panel
|
25
26
|
end
|
26
27
|
|
@@ -29,7 +30,7 @@ class Solar_panel_rebate_egilibility_check
|
|
29
30
|
puts "1. Yes 2. No".colorize(:light_blue)
|
30
31
|
|
31
32
|
answer = gets.chomp.to_i
|
32
|
-
return unless answer_check(answer)
|
33
|
+
return existed_solar_panel unless answer_check(answer)
|
33
34
|
combined_houshold_income
|
34
35
|
end
|
35
36
|
|
@@ -37,7 +38,7 @@ class Solar_panel_rebate_egilibility_check
|
|
37
38
|
puts "Is your household income below $180,000aud?".colorize(:light_blue)
|
38
39
|
puts "1. Yes 2. No".colorize(:light_blue)
|
39
40
|
answer = gets.chomp.to_i
|
40
|
-
return unless answer_check(answer)
|
41
|
+
return combined_houshold_income unless answer_check(answer)
|
41
42
|
property_value
|
42
43
|
end
|
43
44
|
|
@@ -45,24 +46,34 @@ class Solar_panel_rebate_egilibility_check
|
|
45
46
|
puts "Is your property value less than $3 millions?" .colorize(:light_blue)
|
46
47
|
puts "1. Yes 2. No".colorize(:light_blue)
|
47
48
|
answer = gets.chomp.to_i
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
return property_value unless answer_check(answer)
|
50
|
+
eligibility_response
|
51
|
+
end
|
52
|
+
|
53
|
+
def eligibility_response
|
54
|
+
if @answers.size == 0
|
55
|
+
puts "Congrats! You are eligible for solar panel rebate #{Emoji.find_by_alias("clap").raw} #{Emoji.find_by_alias("clap").raw} #{Emoji.find_by_alias("clap").raw}".colorize(:red)
|
56
|
+
else
|
57
|
+
puts "Sorry, you are not eligible for solar panel rebate."
|
54
58
|
end
|
55
59
|
end
|
60
|
+
|
56
61
|
def answer_check(answer)
|
62
|
+
while answer != 1 || answer != 2
|
57
63
|
if answer == 1
|
58
|
-
puts "Please
|
64
|
+
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:light_green)
|
65
|
+
puts " "
|
59
66
|
return true
|
60
67
|
elsif answer == 2
|
61
|
-
puts "
|
62
|
-
|
68
|
+
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}."
|
69
|
+
puts " "
|
70
|
+
@answers << answer
|
71
|
+
return true
|
63
72
|
else
|
64
73
|
puts "It is no a valid input."
|
74
|
+
puts " "
|
65
75
|
return false
|
66
76
|
end
|
67
77
|
end
|
78
|
+
end
|
68
79
|
end
|
data/lib/files_check.rb
CHANGED
@@ -4,12 +4,11 @@ require "colorize"
|
|
4
4
|
require "table_print"
|
5
5
|
|
6
6
|
class Provided_files_check
|
7
|
-
def initialize
|
8
|
-
@name = name
|
7
|
+
def initialize
|
9
8
|
end
|
10
9
|
|
11
10
|
def income_proof
|
12
|
-
puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:
|
11
|
+
puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:blue)
|
13
12
|
url = gets.chomp
|
14
13
|
return unless valid_file_check(url)
|
15
14
|
return unless file_type_check(url)
|
@@ -19,7 +18,7 @@ class Provided_files_check
|
|
19
18
|
def two_forms_of_identity
|
20
19
|
file_arr = []
|
21
20
|
loop do
|
22
|
-
puts "provide identity documents' URL (only .pdf or .doc): "
|
21
|
+
puts "provide identity documents' URL (only .pdf or .doc): ".colorize(:blue)
|
23
22
|
url = gets.chomp
|
24
23
|
return unless valid_file_check(url)
|
25
24
|
return unless file_type_check(url)
|
@@ -32,11 +31,12 @@ class Provided_files_check
|
|
32
31
|
|
33
32
|
|
34
33
|
def retailer_quote
|
35
|
-
puts "Provide the eligible quote URL (only .pdf or .doc): "
|
34
|
+
puts "Provide the eligible quote URL (only .pdf or .doc): ".colorize(:blue)
|
36
35
|
url = gets.chomp
|
37
36
|
file_type = File.extname(URI.parse(url).path)
|
38
37
|
return unless valid_file_check(url)
|
39
38
|
return unless file_type_check(url)
|
39
|
+
eligible_quote(url)
|
40
40
|
end
|
41
41
|
|
42
42
|
def eligible_quote(url)
|
@@ -7,33 +7,30 @@ require_relative 'manage_lists'
|
|
7
7
|
# write the intro
|
8
8
|
# Help file includes *comprehensive* instructions which *accurately* describe: steps to install the application; dependencies required by the application; system/hardware requirements; features of the application.
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
john = Solar_panel_rebate_egilibility_check.new
|
11
|
+
john.ower_of_the_property
|
12
|
+
john_files = Provided_files_check.new
|
13
|
+
# john_files.income_proof
|
12
14
|
|
13
|
-
|
14
|
-
#
|
15
|
-
john_rebate = Rebate_calculator.new
|
16
|
-
# john_rebate.stc_postcode_rating(3000)
|
17
|
-
# john_rebate.stc_calculator(5, 5)
|
18
|
-
# p john_rebate.rebate
|
15
|
+
# list_zone_1 = Manage_list.new
|
16
|
+
# list_zone_2 = Manage_list.new
|
19
17
|
|
20
|
-
#
|
21
|
-
#
|
18
|
+
# list_zone_1.add_applicant("John")
|
19
|
+
# list_zone_1.add_applicant("Sab")
|
22
20
|
|
21
|
+
# list_zone_2.add_applicant("Peppy")
|
22
|
+
# list_zone_2.add_applicant("sup")
|
23
|
+
# list_zone_2.remove_applicant("Peppy")
|
23
24
|
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# a_list.add_to_eligible_list("Peta")
|
27
|
-
# a_list.add_to_eligible_list("Peta")
|
28
|
-
# a_list.remove_applicant("John")
|
25
|
+
# p list_zone_1.list_detail
|
26
|
+
# p list_zone_2.list_detail
|
29
27
|
|
30
28
|
# p Manage_list.display_processing_number
|
31
|
-
# p a_list.eligible_list
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
37
34
|
|
38
35
|
|
39
36
|
|
data/lib/manage_lists.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
|
2
2
|
class Manage_list
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :list_detail
|
4
4
|
@@processing_number = 0
|
5
5
|
def initialize
|
6
|
-
@
|
6
|
+
@list_detail = []
|
7
7
|
end
|
8
8
|
def self.display_processing_number
|
9
9
|
@@processing_number
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
@
|
12
|
+
def add_applicant(name)
|
13
|
+
@list_detail << name
|
14
14
|
@@processing_number += 1
|
15
15
|
end
|
16
16
|
|
17
17
|
def remove_applicant(name)
|
18
|
-
@
|
18
|
+
@list_detail.delete(name)
|
19
19
|
@@processing_number -= 1
|
20
20
|
end
|
21
21
|
end
|