Class: TaxJp::SocialInsurances::WelfarePension
- Inherits:
-
Object
- Object
- TaxJp::SocialInsurances::WelfarePension
- Defined in:
- lib/tax_jp/social_insurances/welfare_pension.rb
Overview
厚生年金
Instance Attribute Summary collapse
-
#child_support ⇒ Object
readonly
Returns the value of attribute child_support.
-
#general ⇒ Object
readonly
Returns the value of attribute general.
-
#grade ⇒ Object
readonly
Returns the value of attribute grade.
-
#particular ⇒ Object
readonly
Returns the value of attribute particular.
-
#salary ⇒ Object
Returns the value of attribute salary.
-
#valid_from ⇒ Object
readonly
Returns the value of attribute valid_from.
-
#valid_until ⇒ Object
readonly
Returns the value of attribute valid_until.
Instance Method Summary collapse
- #general_amount ⇒ Object
- #general_amount_half ⇒ Object
-
#initialize(attrs) ⇒ WelfarePension
constructor
A new instance of WelfarePension.
- #particular_amount ⇒ Object
- #particular_amount_half ⇒ Object
Constructor Details
#initialize(attrs) ⇒ WelfarePension
Returns a new instance of WelfarePension.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 10 def initialize(attrs) if attrs.is_a?(Hash) @grade = attrs[:grade] @valid_from = attrs[:valid_from] @valid_until = attrs[:valid_until] @general= attrs[:general] @particular= attrs[:particular] @child_support = attrs[:child_support] elsif attrs.is_a?(Array) @valid_from = attrs[0] @valid_until = attrs[1] @general= attrs[2] @particular= attrs[3] @child_support = attrs[4] end end |
Instance Attribute Details
#child_support ⇒ Object (readonly)
Returns the value of attribute child_support.
6 7 8 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 6 def child_support @child_support end |
#general ⇒ Object (readonly)
Returns the value of attribute general.
5 6 7 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 5 def general @general end |
#grade ⇒ Object (readonly)
Returns the value of attribute grade.
3 4 5 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 3 def grade @grade end |
#particular ⇒ Object (readonly)
Returns the value of attribute particular.
5 6 7 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 5 def particular @particular end |
#salary ⇒ Object
Returns the value of attribute salary.
8 9 10 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 8 def salary @salary end |
#valid_from ⇒ Object (readonly)
Returns the value of attribute valid_from.
4 5 6 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 4 def valid_from @valid_from end |
#valid_until ⇒ Object (readonly)
Returns the value of attribute valid_until.
4 5 6 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 4 def valid_until @valid_until end |
Instance Method Details
#general_amount ⇒ Object
27 28 29 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 27 def general_amount (salary * general).round(2) end |
#general_amount_half ⇒ Object
31 32 33 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 31 def general_amount_half (general_amount / 2).floor(2) end |
#particular_amount ⇒ Object
35 36 37 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 35 def particular_amount (salary * particular).round(2) end |
#particular_amount_half ⇒ Object
39 40 41 |
# File 'lib/tax_jp/social_insurances/welfare_pension.rb', line 39 def particular_amount_half (particular_amount / 2).floor(2) end |