tensai-core 0.1.2 → 0.1.3

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: 1a3f6bc75c998f6724fcc260d6864fc63803b2651fb8168b26cd94c8e933b5f5
4
- data.tar.gz: 15f5e077f28534d457c3d68e12ab6e373707a2138999e649e65321d511cbb807
3
+ metadata.gz: 5a38d61c0552c55ae738a98e940df39273b40d74cbd3beca6b14e6b533a8a5a5
4
+ data.tar.gz: 6afe1d5a11b6fe578e0ec3c10eab69981fc322e6667b7d7f6266b36a900fe259
5
5
  SHA512:
6
- metadata.gz: 180f611385d4ab59b137e41e13d0a1cceb9787dec7fbfcd755c3165d293674211926389d39e96cecaf842e72e8851fa8865e2ace31e2dad2bf8f9ba81553f210
7
- data.tar.gz: 64be2ab89535cb04099061a81c836f93e580b8d6654e3115dad34d93cd8240708a750ed32e99344550d4cc126e644d73f7084cb5a97ef6e377e6941010cd025f
6
+ metadata.gz: fcb9637cef98d96f5c9b1742a034fcf0d9aedf0a71c2f32c3eb162ef27a797b715015b0b73317975cf3766365ae008d71215b8476bc3cff4936795ed9a3024a6
7
+ data.tar.gz: deecb846c655d8798f5cda9edeca2fb528f729a890f7ee80546ca86749bb1db549cdc9b56586084e8300db811829de87a355d7a715f59f7756bfccb02ec94118
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tensai-core (0.1.1)
4
+ tensai-core (0.1.3)
5
5
  dry-types (~> 1.1)
6
6
 
7
7
  GEM
@@ -58,7 +58,17 @@ module Tensai::Util
58
58
  attr_reader :args
59
59
 
60
60
  def signature
61
- args.keys.map { |arg| "#{arg}:" }.join(', ')
61
+ optional = optional_args.keys.map { |arg| "#{arg}: nil" }
62
+ required = required_args.keys.map { |arg| "#{arg}:" }
63
+ (optional + required).join(', ')
64
+ end
65
+
66
+ def required_args
67
+ args.reject { |_, type| type.optional? }.to_h
68
+ end
69
+
70
+ def optional_args
71
+ args.select { |_, type| type.optional? }.to_h
62
72
  end
63
73
 
64
74
  def check_argument_types_code
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tensai
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensai-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Fischer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types