choron_support 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bf7316c3b2d4d00a2ce3a44168fbafaacea812faeaf3f6224931c4a2db818e4
4
- data.tar.gz: 914705ff4dee8cd847a2f7cf74f0fc9f36f2385a0684fae5aae7df84832e50ef
3
+ metadata.gz: f7da95f65bf957254a5b66f62facc2ca0b10aabc0c3aba36e4441229330b565b
4
+ data.tar.gz: 80b4a4ed2e0be8e67843a4056262adb65a7f66046524572e0b8cac16f8006e9e
5
5
  SHA512:
6
- metadata.gz: b500f4d6235d6ef95a902189323d4556dcf86145e53d6da4393a915d7ef97f657c634baad788d1131580ff205ae7a1f85d8ea5f92e132f1433118cdf1a68d6b6
7
- data.tar.gz: 909f8933d732bbc947bdd723d7addc9738d8aa552f4086ed3b35e541c789d2309cfc0084e17475e7f11b313cffe9905fdd18cd20eef1e365e04910d5a1283b9d
6
+ metadata.gz: 633b6143e63daf2672fccdebbd24f73238a16ec04d7faa248ad6c6cc26626f433dae771fef2ef7c7129f72d5dfcfe5a506225e81f80a75240e681fa60ebaf5b2
7
+ data.tar.gz: 4f968293d35924ed6fddbe222c59fbb69ae7e538b36bdf71ee118598650bc16d9484dd219c27d2a183762ca04a00f2018aa58aa04f1ae7423ff2b25b04d082e3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- choron_support (0.1.1)
4
+ choron_support (0.1.2)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -26,7 +26,7 @@ module ChoronSupport
26
26
  props_class_name = "#{namespace}::#{class_name}"
27
27
  when nil
28
28
  namespace = "Props"
29
- # 例: User
29
+ # 例: User / Master::Plan
30
30
  class_name = self.class.to_s
31
31
  # 例: Props::User
32
32
  props_class_name = "#{namespace}::#{class_name}"
@@ -13,10 +13,22 @@ module ChoronSupport
13
13
  # @param [Symbol] option domain_to_method 委譲先のDomainクラスの呼び出しメソッドを指定できます。デフォルトは :call です
14
14
  # @exampl
15
15
  # class User < ApplicationRecord
16
- # domain_for :purchase
16
+ # domain_delegate :purchase
17
17
  # #=>
18
18
  # def purchase(item)
19
- # Domains::Users::Purchase.new(self).run(item)
19
+ # Domains::Users::Purchase.new(self).call(item)
20
+ # end
21
+ #
22
+ # domain_delegate :purchase, specific: false
23
+ # #=>
24
+ # def run_get(item)
25
+ # Domains::Purchase.new(self).call(item)
26
+ # end
27
+ #
28
+ # domain_delegate :purchase, specific: false, class_name: "Domains::Buy", to: :buy_user
29
+ # #=>
30
+ # def purchase(item)
31
+ # Domains::Buy.new(self).buy_user(item)
20
32
  # end
21
33
  # end
22
34
  def self.domain_delegate(method_symbol, specific: true, class_name: nil, to: :call)
@@ -7,7 +7,7 @@ module ChoronSupport
7
7
 
8
8
  # Modelにアクセスするためのメソッドを作成する
9
9
  # Userであれば user, UserFeedBack であれば user_feed_back というように単数系スネークケースでアクセス可能にする
10
- model_method_name = model.class.to_s.underscore
10
+ model_method_name = model.class.to_s.underscore.gsub("/", "_")
11
11
  self.define_singleton_method(model_method_name) do
12
12
  @model
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChoronSupport
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: choron_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mksava
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-04 00:00:00.000000000 Z
11
+ date: 2023-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport