drsi 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 6b99bdc02a78b72391449fe80e587f114dc2fca0
4
- data.tar.gz: 707d75c55602ea782f5fdda5441c475f263de7bd
3
+ metadata.gz: 11309067339e57a0aa6717ea6034208661896539
4
+ data.tar.gz: 139fd79736dea05182ac7ec019a5d4d7a98648cd
5
5
  SHA512:
6
- metadata.gz: 6a994734ded3c5039e348dc4fcd2daa40f2927b8a48606daf6bc8fa01d3c8dc2113030fb05faa82279a2391ec8f23df287d061afeb76e2bfa90f48e2fc6f43b5
7
- data.tar.gz: 3831df641d260d23c583a1d79d93870cc81c8ef82c336b94703187bfe7693717da83376506e277ca4b889c943ac5eb26cf8c15cfb87b3d4cd812700ae2468bc1
6
+ metadata.gz: c4aae9e60790998f6f1e194d3dd1b0aff8d1c85012bad35e4ef118d982d40254983be9868754714b7f465c2292a8e878c46a4243b79977b1245e9a131f9dcee7
7
+ data.tar.gz: c21408e5e63dc26e2ea4cb9d687208ae6b33e9506f5c55ef3c02fcb7f47cb26181a6fbb43d2f6ee5b92ae62e9bec0bd67d2d1be9f9aa3af17f73e1caaa9babda
@@ -13,7 +13,7 @@ module DCI
13
13
  def self.roles; @roles end
14
14
  def roles; self.class.roles end
15
15
  private :roles
16
- assign_unplay_roles_within_klass_instance_methods!(subklass)
16
+ assign_unplay_roles_within_instance_methods!
17
17
  end
18
18
  end
19
19
 
@@ -77,14 +77,14 @@ module DCI
77
77
  # player objects before the execution and to un-assign roles from player objects at the end of execution just
78
78
  # before returning control.
79
79
  # Also inject code to magically do the same to every new method defined in klass.
80
- def assign_unplay_roles_within_klass_instance_methods!(klass)
81
- klass.instance_methods(false).each do |existing_methodname|
82
- assign_unplay_roles_within_klass_instance_method!(klass, existing_methodname)
80
+ def assign_unplay_roles_within_instance_methods!
81
+ instance_methods(false).each do |existing_methodname|
82
+ assign_unplay_roles_within_instance_method!(existing_methodname)
83
83
  end
84
- def klass.method_added(methodname)
84
+ def self.method_added(methodname)
85
85
  if not @context_internals and public_method_defined?(methodname)
86
86
  @context_internals = true
87
- assign_unplay_roles_within_klass_instance_method!(self, methodname)
87
+ assign_unplay_roles_within_instance_method!(methodname)
88
88
  @context_internals = false
89
89
  end
90
90
  end
@@ -92,8 +92,8 @@ module DCI
92
92
 
93
93
  # Wraps the given klass's methodname to assign/un-assign roles to player objects before and after actual method
94
94
  # execution.
95
- def assign_unplay_roles_within_klass_instance_method!(klass, methodname)
96
- klass.class_eval do
95
+ def assign_unplay_roles_within_instance_method!(methodname)
96
+ class_eval do
97
97
  method_object = instance_method(methodname)
98
98
  define_method(methodname) do |*args, &block|
99
99
  players_play_role!
@@ -1,3 +1,3 @@
1
1
  module Drsi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorenzo Tello