rao-service 0.0.2.pre → 0.0.3.pre

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
  SHA1:
3
- metadata.gz: 8a453d7bad543b288e31572b87c313a28e19597e
4
- data.tar.gz: baadcaee6910fb4c866914000ba63209e3ceda75
3
+ metadata.gz: 76b726563a70005b359c1a602bb1ac676e1a5ba8
4
+ data.tar.gz: 89ff543b4a5d5a8e37c6bd133e21661c19a0ee61
5
5
  SHA512:
6
- metadata.gz: 2440d8288cd48ea63f42595931cd665234995e6d4a5e39a396bb211964e4560cabc6cf3d8022dee9cdbec55414b130de0a231c31c8f46a1026e3534a346a5870
7
- data.tar.gz: 52aaf54967964788d15586ffd39e06deb7f22ba3da001f7d2c7bbe3439a3b9ab51af201c95d138748d2e13f060b3b33f21981d517915265dcdabdd87b47c70f3
6
+ metadata.gz: a30725bad950b66d9493c9e8808e35b2403923623134de459d83cec91fa696df6a41ac7a1788e8820d14b21a6208ffe4278d4aa26294487a49920152e77d1bbb
7
+ data.tar.gz: 441295cb727e264a31d8012739821e2837beb4cee8d06d78b88de72d72081ee96eb4ddb2f0880928291fa852ebcb37585175ba37004f1865e3077cf79ff9a585
@@ -0,0 +1,9 @@
1
+ module Rao
2
+ module Service
3
+ class Job < ApplicationJob
4
+ def perform(service_class_name, attributes = {}, options = {})
5
+ service_class_name.constantize.call(attributes, options)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -47,6 +47,12 @@ module Rao
47
47
  send("#{key}=", value)
48
48
  end
49
49
  end
50
+
51
+ def attributes
52
+ self.class.attribute_names.each_with_object({}) do |attr, m|
53
+ m[attr] = send(attr)
54
+ end
55
+ end
50
56
  end
51
57
 
52
58
  include Attributes
@@ -68,6 +74,7 @@ module Rao
68
74
  _perform
69
75
  end
70
76
  after_perform
77
+ save if autosave? && respond_to?(:save, true)
71
78
  perform_result
72
79
  end
73
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rao-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.pre
4
+ version: 0.0.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-13 00:00:00.000000000 Z
11
+ date: 2018-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -132,6 +132,7 @@ files:
132
132
  - MIT-LICENSE
133
133
  - README.md
134
134
  - Rakefile
135
+ - app/jobs/rao/service/job.rb
135
136
  - app/mailers/rao/service/application_mailer.rb
136
137
  - app/mailers/rao/service/notification_mailer.rb
137
138
  - app/views/rao/service/notification_mailer/result_email.text.erb