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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d29651fb19d5f1cb191e062cffbd1019ebed23db3d308578e52ddf798148c72
4
- data.tar.gz: 291bbf812a009879886a76f091dc885f4b94a2877cd40ece6cfe2728fb890ee7
3
+ metadata.gz: e70b3529253c794d9124c464ecb0807c83b5fd5306dcd7d3d6f3e2e660f39ef8
4
+ data.tar.gz: c0fc605c1d36fb238c5135e9747470303a875474a72d5d95c05bfd2474351a6d
5
5
  SHA512:
6
- metadata.gz: 5e6987f8de550fa91dcab2b0ea1bd4d40aa3b037c39c7fbdd15b9dd1f8496a2f0cd363b6181ac7097ac1a244c8f22df973377d3bf9e564ec8f78096508f1646d
7
- data.tar.gz: f5e2314c84bcb9265246b671f53fc50bff2fed28c28a20e7c8b953c131c5bf313d6fc8905fb3f451c3b1f7d49cd76fe68dc4fe6e24647abe4bcc81ca3a9c916f
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)
@@ -7,7 +7,7 @@ module Ucasy
7
7
  end
8
8
 
9
9
  def call
10
- raise NotImplementedError, "You must implement call method"
10
+ raise NotImplementedError, "You must implement #call method in #{self.class}"
11
11
  end
12
12
  end
13
13
  end
@@ -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 '#{self.class}'"
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
@@ -1,3 +1,3 @@
1
1
  module Ucasy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-06 00:00:00.000000000 Z
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.9
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