zyra 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c8f905bbdb0fec56487d7be0a0999983394975cfe3878397ffa7b12f8b43229
4
- data.tar.gz: ef03ada86291579a39b0f1dbb9b4bd6dc868090752240522eb22a5c89d6ad559
3
+ metadata.gz: 62a10b511a268b79401186b32fb0c25fe60cfbe062770f8d6de2d97a6dfee4ea
4
+ data.tar.gz: 9f5a45fc0216b1e65a7d2f5482a05087ef78787accf8c5e940bf26794e5ca7bb
5
5
  SHA512:
6
- metadata.gz: 6132bf64c4fb482e408c24d6e84964bc7862ed31890ee3257608476ee659e63252db0f01602da4afe367ce7a8f6661c65d7099634a9982aa97b20c6d10817d29
7
- data.tar.gz: 8b79a9c2f74a31b83e50e98571920f6b3d2e8ac441c58a64e88dd9224a2b5bfe7a5bd043bc5b131c63d2857d6840ff1b9e8f0f1fa1e1009bc213a7fcc808d29b
6
+ metadata.gz: 0c63b3d56aec07eacdc683fb8c8084ddb1a5f8c45011bcd8f85ce43a08df85c7d412482256075539038b266d7678dfe36a019dd36267402b8bc625ec4c821a71
7
+ data.tar.gz: bc6e5d3e3a3d3695716b048c40ea29bfeb43e62f3ffd192fb94f5887526acba84b28dcabaed422d1dd9c9e8caaa9a4b5d51528ac0504a5146b1cb79b8816c548
data/README.md CHANGED
@@ -17,7 +17,7 @@ a creation in case of missing the entry
17
17
 
18
18
  Yard Documentation
19
19
  -------------------
20
- [https://www.rubydoc.info/gems/zyra/1.0.0](https://www.rubydoc.info/gems/zyra/1.0.0)
20
+ [https://www.rubydoc.info/gems/zyra/1.1.0](https://www.rubydoc.info/gems/zyra/1.1.0)
21
21
 
22
22
  Installation
23
23
  ---------------
data/lib/zyra/creator.rb CHANGED
@@ -24,10 +24,12 @@ module Zyra
24
24
  #
25
25
  # @return [Object] an instance of model class
26
26
  def create(**attributes, &block)
27
- model = build(**attributes, &block)
27
+ block ||= proc {}
28
+
29
+ model = build(**attributes)
28
30
 
29
31
  event_registry.trigger(:create, model) do
30
- model.tap(&:save)
32
+ model.tap(&:save).tap(&block)
31
33
  end
32
34
  end
33
35
 
@@ -39,10 +41,8 @@ module Zyra
39
41
  # @param (see #create)
40
42
  # @yield (see #create)
41
43
  # @return (see #create)
42
- def build(**attributes, &block)
43
- block ||= proc {}
44
-
45
- model_class.new(attributes).tap(&block).tap do |model|
44
+ def build(**attributes)
45
+ model_class.new(attributes).tap do |model|
46
46
  event_registry.trigger(:build, model)
47
47
  end
48
48
  end
data/lib/zyra/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zyra
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zyra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee