rails_application_service 0.6.0 → 0.6.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: b7e3b78a33f41ea84a56ce29d482a739d1c4431122ec8eb766d76fd4d4598552
4
- data.tar.gz: 5cf617de77f52dad4444d4cdfefbfd84b62e1bf2d54a3e0140dd64d890ab5661
3
+ metadata.gz: 5cc940286dc1211b1da1d8a01b48cff5ea2eb27c6680421870a05e6be229717b
4
+ data.tar.gz: f30bebb401ab83cc2db9c0489ece9e14a3dfb3d951179bbddb6d2f6838a01831
5
5
  SHA512:
6
- metadata.gz: 6116887b8a93ab25f5efcea6ab0e03c3f9cffd75aa7be4df4437956979db258b9d9ac671fa43323ebf26b2e78a5b3787c36ea888c41d07063d46e2c0d99e8948
7
- data.tar.gz: cf929d8a4dad1d3f330a35b65cf1506aa67d0c0ab18c3113b9bab6a1451593c1862f74c321bf0a6fac15dd24fdee79073dfbb7f2b9400971c581a13743f7d561
6
+ metadata.gz: 296081b4f58ce03e5a89865da7e842a7b53be4c231ffbc4c931adf04fbf2e8d1e9b80a7f986f82c207597c2e6ff11a77aa6bfef1ddda2a69a1ad3373eab4b4c9
7
+ data.tar.gz: 6e2e0b4f148f50d9f5d097b306135d35f92b122abb20a160ef6079411f972d553bc0ec64fa57b8f9413e08ed0264f06713022747d1b800e1de9d1bea8a65d0c2
data/CHANGELOG.md CHANGED
@@ -5,7 +5,29 @@ All notable changes to this project are documented in this file.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.6.0] - 2025-06-16
8
+ ## [0.6.2] - in progress
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+ - Simplified docs
14
+
15
+ ### Removed
16
+
17
+ ### Breaking Changes
18
+
19
+ ## [0.6.1] - 2025-06-18
20
+
21
+ ### Added
22
+
23
+ ### Changed
24
+ - Enhanced the changelog
25
+
26
+ ### Removed
27
+
28
+ ### Breaking Changes
29
+
30
+ ## [0.6.0] - 2025-06-18
9
31
 
10
32
  ### Added
11
33
 
@@ -16,7 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
38
 
17
39
  ### Breaking Changes
18
40
 
19
- ## [0.5.0] - 2025-06-16
41
+ ## [0.5.0] - 2025-06-18
20
42
 
21
43
  ### Added
22
44
 
@@ -30,7 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
52
 
31
53
  ### Breaking Changes
32
54
 
33
- ## [0.4.0] - 2025-06-16
55
+ ## [0.4.0] - 2025-06-05
34
56
 
35
57
  ### Added
36
58
  - Added support for `ActiveModel::API` and `ActiveModel::Attributes`
data/README.md CHANGED
@@ -24,7 +24,7 @@ mkdir -p app/services
24
24
 
25
25
  ## Usage
26
26
 
27
- The `ApplicationService::Base` class provides a standard interface for calling service objects with robust type handling and validations. It leverages `ActiveModel::API` for initialization with keyword arguments, `ActiveModel::Attributes` for type casting, and `ActiveModel::Validations` for input validation.
27
+ The `ApplicationService::Base` class provides a standard interface for calling service objects. It leverages `ActiveModel` for initialization with keyword arguments and input validation.
28
28
 
29
29
  ### Basic service example
30
30
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApplicationService
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
@@ -8,16 +8,13 @@ require "active_model"
8
8
  # perform a single action or a series of related actions.
9
9
  module ApplicationService
10
10
  # The Base class within the ApplicationService module provides a standard
11
- # interface for calling service objects with robust type handling and validations.
12
- # It leverages ActiveModel::API for initialization with keyword arguments,
13
- # ActiveModel::Attributes for type casting, and ActiveModel::Validations for
14
- # input validation.
11
+ # interface for calling service objects. It leverages ActiveModel for
12
+ # initialization with keyword arguments and input validation.
15
13
  #
16
14
  # Example usage:
17
15
  #
18
16
  # class Sum < ApplicationService::Base
19
- # attribute :number_a, :integer
20
- # attribute :number_b, :integer
17
+ # attr_accessor :number_a, :number_b
21
18
  #
22
19
  # validates :number_a, :number_b, presence: true, numericality: { greater_than: 0 }
23
20
  #
@@ -27,22 +24,8 @@ module ApplicationService
27
24
  # end
28
25
  #
29
26
  # sum = Sum.call(number_a: 1, number_b: 2) # => 3
30
- #
31
- # This gem supports the following attribute types through ActiveModel::Attributes and
32
- # other custom types defined in ActiveModel::Type:
33
- #
34
- # - :boolean
35
- # - :date
36
- # - :datetime
37
- # - :decimal
38
- # - :float
39
- # - :integer
40
- # - :string
41
- # - :time
42
27
  class Base
43
- include ::ActiveModel::API
44
- include ::ActiveModel::Attributes
45
- include ::ActiveModel::Validations
28
+ include ::ActiveModel::Model
46
29
 
47
30
  # Initializes a new instance of the service object.
48
31
  #
@@ -51,9 +34,9 @@ module ApplicationService
51
34
  def initialize(**kwargs)
52
35
  super
53
36
 
54
- if instance_of?(Base)
55
- raise ::NotImplementedError, "#{self.class.name} is an abstract class and cannot be instantiated directly"
56
- end
37
+ return unless instance_of?(Base)
38
+
39
+ raise ::NotImplementedError, "#{self.class.name} is an abstract class and cannot be instantiated directly"
57
40
  end
58
41
 
59
42
  # Instantiates a new service object and invokes its `call` method.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_application_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mário Marroquim
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-06-18 00:00:00.000000000 Z
10
+ date: 2025-08-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel
@@ -47,7 +47,7 @@ licenses:
47
47
  metadata:
48
48
  homepage_uri: https://github.com/mariomarroquim/rails_application_service
49
49
  changelog_uri: https://github.com/mariomarroquim/rails_application_service/CHANGELOG.md
50
- rubygems_mfa_required: 'false'
50
+ rubygems_mfa_required: 'true'
51
51
  rdoc_options: []
52
52
  require_paths:
53
53
  - lib