toritori 0.2.0 → 0.2.1

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: 47da200bc6b1c00517984ac052c3f3c1f3eab8dcfb9444158a893fb3e254bef4
4
- data.tar.gz: 11da3242909586815d5c564c9ab80b04ccdd66b0cc02b96f61d416758c265c3f
3
+ metadata.gz: eaa8ad4915b1a30d7e653060e3b9bf1e245e5933d849bb8e7f62e544295907fc
4
+ data.tar.gz: 8aa97304d8dcfd2d0c182d31631713cb2b25b530059057c59c24287555fd393e
5
5
  SHA512:
6
- metadata.gz: 4887c90e93f2a13c8942b6b7028f957dead740214ebdadc4717f71ef5005a7dd672c3559b9523bc52e4e741c94cfba637ec4b27215eb31c1bf003a6a027130fd
7
- data.tar.gz: cf38a85c4d6efd4989f49740dfeb373780325b88007d34bbb18841b7efb6987c924d80516229cf6c17a389471ca772b1eafe26fad792c752b31eda65e68a41bc
6
+ metadata.gz: 443583cf5aeb8cd4a888237a13cec6077b6f1aad57a0187da47420a3ba4c28669e5e7bb6c3773bd8410192be58e26293fd2e3bb22a0564ef56aa76808ca233c3
7
+ data.tar.gz: 1169e0c5495a9b5f609864d1d64ad76dc380d7f9579707a3e98f0622fe79be7ccde0adacf27417ac560915f3069348f491a9015936aac4bbc7955d8744b4c388
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toritori (0.2.0)
4
+ toritori (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,6 +3,8 @@
3
3
  module Toritori
4
4
  # Generates module that adds support for objects creation
5
5
  class Factory
6
+ attr_reader :base_class, :creation_method
7
+
6
8
  def copy
7
9
  self.class.new(@name, base_class: @base_class, creation_method: @creation_method)
8
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Toritori
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/lib/toritori.rb CHANGED
@@ -28,6 +28,10 @@ module Toritori
28
28
  super
29
29
  subclass.factories = factories.transform_values(&:copy)
30
30
  end
31
+
32
+ def create(name, *args, **kwargs, &block)
33
+ factories[name].create(*args, **kwargs, &block)
34
+ end
31
35
  end
32
36
 
33
37
  def self.included(receiver)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toritori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrii Baran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-12-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create factories with DSL
14
14
  email: