inss_calculator 0.4.1 → 0.4.2

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: dda408b24c4c0da00dbd74687fb89520ec440d089c169bb16bb9fef83163f287
4
- data.tar.gz: d86a04f19fb5fb6b66115f60f0b4026cb4594b8771d50ad422c4f9f9f330adbb
3
+ metadata.gz: b0c5d044bf05b0f50ac8c9b4b6fe0634e0f809fd18918fd84a8a15a5fcbfd09a
4
+ data.tar.gz: 56906b9378630a07cb21ab2fab31caf77511a2808b78d347270ccde37df6ea08
5
5
  SHA512:
6
- metadata.gz: 553359d8be075e3c58c83e9512f2f8d5a3247be37fa878bc13baa0c9d76ff6f6530d6ff772ca5925e5c9bce181ddc5212cc73dc5af77293cca500c8dc6dae6ef
7
- data.tar.gz: 8b8f0a3a04ea4148c8608b2a76ed8335b8e7a0e6f86f96ac5c6a373c47ccd6fededb58398a1186963d01494ae11a886be90e6b016e9838dea7b3aa709ea8e423
6
+ metadata.gz: 54a10e9bda6faff9e6ce0765aa5ae6ceb92dbd0fe333995312860acc68bb15a6c085eb0a17097a0937fdb56d392f4fb61f4912676ae77e80d2bfd387e17e244a
7
+ data.tar.gz: 1ed31865a00db8bd38a9b782bcd0d7cd2e899e3743b221de2de85e8ffcf391e3dfaa5fb7308d7763c0df02c777fbbbad1554ecf82a6bf61b087f39166c732cd3
@@ -9,7 +9,7 @@ module InssCalculator
9
9
  class Text
10
10
  extend Forwardable
11
11
 
12
- def_delegators :@calculator, :salary, :net_salary, :contribution
12
+ def_delegators :@calculator, :salary, :net_salary
13
13
 
14
14
  attr_reader :calculator
15
15
 
@@ -17,6 +17,10 @@ module InssCalculator
17
17
  @calculator = inss_calculator
18
18
  end
19
19
 
20
+ def contribution
21
+ Dinheiro.new(calculator.contribution).real_formatado
22
+ end
23
+
20
24
  def present
21
25
  "#{salary_text} #{contribution_text} #{net_salary_text}"
22
26
  end
@@ -22,5 +22,9 @@ module InssCalculator
22
22
  def net_salary
23
23
  (salary - contribution).round(2)
24
24
  end
25
+
26
+ def present
27
+ raise InssCalculator::NoMethodError, message: 'Use a decorator instead!'
28
+ end
25
29
  end
26
30
  end
@@ -0,0 +1,5 @@
1
+ module InssCalculator
2
+ class NoMethodError < InssCalculator::Error
3
+ end
4
+ end
5
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InssCalculator
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
@@ -42,3 +42,5 @@ module InssCalculator
42
42
  EIGTH_SALARY_BASE = 52_000.55
43
43
  EIGTH_SALARY_LIMIT = Float::INFINITY
44
44
  end
45
+
46
+ require_relative 'inss_calculator/error/no_method_error'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inss_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Felipe Souza
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-23 00:00:00.000000000 Z
11
+ date: 2025-01-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Calcula o valor a descontar de acordo com a faixa salarial. Os novos
14
14
  valores corrente em 2024.
@@ -35,6 +35,7 @@ files:
35
35
  - lib/inss_calculator/discount_calculator_base.rb
36
36
  - lib/inss_calculator/discount_previdence_calculator.rb
37
37
  - lib/inss_calculator/eigth_discount_calculator.rb
38
+ - lib/inss_calculator/error/no_method_error.rb
38
39
  - lib/inss_calculator/fifth_discount_calculator.rb
39
40
  - lib/inss_calculator/first_discount_calculator.rb
40
41
  - lib/inss_calculator/fourth_discount_calculator.rb