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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10f33c8671399f864f967ec948a70564c760a25141749d48d2d1b4081569525b
4
- data.tar.gz: fa4f6265e42895b16660786b35c00141cb43cf4eacd016b11bb0ab035d7c8353
3
+ metadata.gz: f32226133848f91f9a4fb703fc0ba6d36c0ce139268b8ca02607843a1bbca85e
4
+ data.tar.gz: 02476d1b39041fd5d32ed969220bbb25adcbc9fed76d91ff438da8642ba58a33
5
5
  SHA512:
6
- metadata.gz: 746b9834e84a186455611f39e643eb96294b9f20b37f916dfa03d21b82645fa6f38816b22e88bcbbdcd2449727c57947cee8e37f70468ef9a7138b509e2705b0
7
- data.tar.gz: 61e77209c2b6a2468c4ab62e5652862bb53ca2754da5ec293741440263cf04aed8f96dd5c2f27fe497b7da38d511781774d7f07bc03b5d164f02a97c633373d6
6
+ metadata.gz: db954cb8e4a3ea37b6c55febdc105da497a836f9532713e5d3e26d46d1fe35f971eac00c844a1d79c303f3eb0dc1bdfafeeb371eac1b37545f85b26094cc5185
7
+ data.tar.gz: f4eb90d5e47282dc0874dda094544f95306528e140ff2836169b34e038fec157315eb8551f44e868de83d5221e4ac2717b51a7e60f6db3d4ad46091bf829b4d9
@@ -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(name)
8
- @name = name
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
- if answer == 1
49
- puts "congrats! You are eligible for this rebate!".colorize(:light_red)
50
- elsif answer == 2
51
- puts "Sorry, your are not eligible."
52
- else
53
- puts "no valid input."
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 answer the next question.".colorize(:light_blue)
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 "Sorry, your are not eligible."
62
- return false
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(name)
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(:light_blue)
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
- ruby = Solar_panel_rebate_egilibility_check.new("Ruby")
11
- ruby.ower_of_the_property
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
- john_files = Provided_files_check.new("john_files")
14
- # john_files.two_forms_of_identity
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
- # peta_files= Provided_files_check.new("peta_files")
21
- # peta_files.retailer_quote
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
- # a_list = Manage_list.new
25
- # a_list.add_to_eligible_list("John")
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
- # john_rebate = Rebate_calculator.new
34
- # john_rebate.stc_postcode_rating(3163)
35
- # john_rebate.stc_calculator(3, 15)
36
- # p john_rebate.rebate
30
+
31
+
32
+
33
+
37
34
 
38
35
 
39
36
 
@@ -1,3 +1,3 @@
1
1
  module JishanFastTrackGem
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/manage_lists.rb CHANGED
@@ -1,21 +1,21 @@
1
1
 
2
2
  class Manage_list
3
- attr_reader :eligible_list
3
+ attr_reader :list_detail
4
4
  @@processing_number = 0
5
5
  def initialize
6
- @eligible_list = []
6
+ @list_detail = []
7
7
  end
8
8
  def self.display_processing_number
9
9
  @@processing_number
10
10
  end
11
11
 
12
- def add_to_eligible_list(name)
13
- @eligible_list << name
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
- @eligible_list.delete(name)
18
+ @list_detail.delete(name)
19
19
  @@processing_number -= 1
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jishan_fast_track_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jishan_Lu