ucasy 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ucasy/base.rb +1 -1
- data/lib/ucasy/callable.rb +1 -1
- data/lib/ucasy/validators/required_attributes.rb +3 -2
- data/lib/ucasy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e70b3529253c794d9124c464ecb0807c83b5fd5306dcd7d3d6f3e2e660f39ef8
|
4
|
+
data.tar.gz: c0fc605c1d36fb238c5135e9747470303a875474a72d5d95c05bfd2474351a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b938a4e73bd4b502b37ad3b69e0a288413fe1ec50b336d9c2fce6a7bb1bcb0069da554af3ee84ff199af5e00968a4e01688dfa5157e183c9d50be40ffc2e5ae9
|
7
|
+
data.tar.gz: 10aa2a1783aebbc499e0c88894c48d5d9b010b2bacc737ea10d56a759296996ed677b3327a7264f7c2397061303e2bd706142f90094450fc05f68ee4f91a11fe
|
data/lib/ucasy/base.rb
CHANGED
@@ -40,7 +40,7 @@ module Ucasy
|
|
40
40
|
attr_reader :context
|
41
41
|
|
42
42
|
def validate_required_attributes!
|
43
|
-
Validators::RequiredAttributes.call(context, self.class._required_attributes)
|
43
|
+
Validators::RequiredAttributes.call(context, self.class._required_attributes, self.class)
|
44
44
|
end
|
45
45
|
|
46
46
|
def method_missing(method_name, *, &block)
|
data/lib/ucasy/callable.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
module Ucasy::Validators
|
2
2
|
class RequiredAttributes < Ucasy::Callable
|
3
|
-
def initialize(context, required_attributes)
|
3
|
+
def initialize(context, required_attributes, klass)
|
4
4
|
@context = context
|
5
5
|
@required_attributes = required_attributes
|
6
|
+
@klass = klass
|
6
7
|
end
|
7
8
|
|
8
9
|
def call
|
9
10
|
@required_attributes.each do |attribute|
|
10
11
|
next if @context.respond_to?(attribute)
|
11
12
|
|
12
|
-
raise ArgumentError, "You must set '#{attribute}' variable in '#{
|
13
|
+
raise ArgumentError, "You must set '#{attribute}' variable in '#{@klass}'"
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
data/lib/ucasy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucasy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lavenda Software
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
|
-
rubygems_version: 3.5.
|
62
|
+
rubygems_version: 3.5.10
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: Ucasy is just a quick test suite setup for Rails application
|