currentpredictor 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/currentpredictor.rb +86 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0d2b5fca01434c0c57a18e9a3868af912253ac6c
4
+ data.tar.gz: b476f52062502d0f2de24585ccb577dafc74cd3c
5
+ SHA512:
6
+ metadata.gz: 0dfc39e7433416382f533571adf0803fe976cbbdbe51e53db538050e84b064dcc6f375528ada4c872231b6e468d4a22409861397d873dbe21193e0249ae445e8
7
+ data.tar.gz: b42f5b489bcba2d5883ebb35d701a15467c778282ee75a58ab45e4412b5ea127792c8d96fb01395f7c796d5639afc874663f89787986c18674f8383af64675a8
@@ -0,0 +1,86 @@
1
+ module CurrentPredictor
2
+ class Calculation
3
+ def self.yearlyconsumption_onrooms(matter,room,cost)
4
+ consumption = matter
5
+ cost = cost
6
+ puts "Enter the number of rooms : "
7
+ a = room
8
+ b = consumption*a
9
+ c = b*cost
10
+ puts "Yearly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH"
11
+ return a,b,c
12
+ end
13
+
14
+ def self.monthlyconsumption(matter,room,cost)
15
+ consumption = matter
16
+ cost = cost
17
+ puts "Enter the number of rooms : "
18
+ a = room
19
+ b = (consumption*a)/12
20
+ c = b*cost
21
+ puts "Monthly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH and the cost is #{c}"
22
+
23
+ return a,b,c
24
+ end
25
+ def self.consumption(appliances,regular,cost)
26
+ appconsumed = appliances
27
+ reg = regular
28
+ cost = cost
29
+ sum = 0
30
+ reg.each do |ammenties,watt|
31
+ appconsumed.each do |key,value|
32
+ if (key == ammenties)
33
+ washing = value * watt
34
+ sum = washing+sum
35
+ end
36
+ if (key == ammenties)
37
+ light = value * watt
38
+ sum = light+sum
39
+ end
40
+ if (key == ammenties)
41
+ cooker = value * watt
42
+ sum = cooker+sum
43
+ end
44
+ if (key == ammenties)
45
+ computer = value * watt
46
+ sum = computer+sum
47
+ puts "THE SUM OUTSTIDE IS #{sum}"
48
+ end
49
+ end
50
+ end
51
+ puts "THE SUM OUTSTIDE IS #{sum}"
52
+
53
+ sum = sum/1000
54
+ puts "THE SUM OUTSTIDE IS #{sum}"
55
+ amount = sum * cost
56
+ puts "Complete consumption per day for you is #{sum} KWH and its cost is #{amount}"
57
+ month = sum * 30
58
+ value = cost * month
59
+ puts "Complete consumption per month for you is #{month} KWH and its cost is #{value} "
60
+ return sum,month,value
61
+ end
62
+ def self.basedonmeter(cost, standardcharge,pslv,previousreading,currentreading)
63
+ cost = cost
64
+ puts cost
65
+ standardcharge = standardcharge
66
+ puts standardcharge
67
+ standardcharge = (standardcharge/12).to_i
68
+ puts standardcharge
69
+ pslv = pslv
70
+ puts pslv
71
+ pslv = (pslv/12).to_i
72
+ puts pslv
73
+ previousreading = previousreading.to_i
74
+ currentreading = currentreading.to_i
75
+ puts previousreading
76
+ puts currentreading
77
+ meterreading = (currentreading-previousreading)
78
+ finalcost = ((meterreading*cost)+standardcharge+pslv)
79
+ puts finalcost
80
+ return meterreading,finalcost
81
+
82
+ end
83
+ end
84
+ end
85
+
86
+
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: currentpredictor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Manoj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: returns if the value is being multiplied with the provider
14
+ email: manojitkannan@email.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/currentpredictor.rb
20
+ homepage: http://rubygems.org/gems/currentpredictor
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.6.8
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Calculates electricity bill based on the user needs
43
+ test_files: []