inclusion 1.0.3 → 1.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inclusion/inclusion.rb +7 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb4bf4f3c7602eaf0acc0d2cdef659f17a699aa6
4
- data.tar.gz: 05c08fb08d78f83fad2112fb84ff22b8c6d773d9
3
+ metadata.gz: 26016a50fa13dc345d3e462f7a92b680b198053f
4
+ data.tar.gz: da5afcb3dae1c4e498baa90c85752cc62a4837c8
5
5
  SHA512:
6
- metadata.gz: 2559175cd12beaad2fa50c8e7300724f41adbc96312aa2cc4b676195c0ad9a80d81155562bd8960b6ef49323a627c76afcd5b48585b0cd4c9dd9e2156e42c031
7
- data.tar.gz: d6923c8082bdc068691fb2f0f11d07d78297cee86b976413b9eecdbc5ea1b6b8ca8f26bb9ad853e04e7672a2b8f65e34905822a419d6a215bfa0bf377d907b62
6
+ metadata.gz: ae5fdff9dd45003ebe32b7c3f326c965168228138dd0e4a5087892f9ec936dbb4f1a96eb786c9d385d539499e015be724185429b3b5764ba08f7012c6f3304ec
7
+ data.tar.gz: 465858ad6e792c48d98b60ab71555faf946ed8db7f1f91da4c207251c390d6e1b6e4dbab44a4a677dadce5694c0b0ba6aadacb865b3c72f79710fb5ebd93d72b
@@ -1,18 +1,20 @@
1
1
  class Inclusion
2
2
  attr_reader :obj
3
3
  attr_reader :inclusion_names
4
+ attr_reader :search_ancestors
4
5
 
5
6
  def obj_const
6
7
  @obj_const ||= ([Module, Class].include?(obj.class) ? obj : obj.class)
7
8
  end
8
9
 
9
- def initialize(obj, inclusion_names)
10
+ def initialize(obj, inclusion_names, search_ancestors: false)
10
11
  @obj = obj
11
12
  @inclusion_names = inclusion_names
13
+ @search_ancestors = search_ancestors
12
14
  end
13
15
 
14
- def self.!(obj, *inclusion_names)
15
- new(obj, inclusion_names).!
16
+ def self.!(obj, *inclusion_names, search_ancestors: false)
17
+ new(obj, inclusion_names, search_ancestors: search_ancestors).!
16
18
  end
17
19
 
18
20
  def !
@@ -65,10 +67,10 @@ class Inclusion
65
67
  end
66
68
 
67
69
  def includion_mod(mod, inner)
68
- mod.const_get(inner, search_ancestors=false)
70
+ mod.const_get(inner, search_ancestors)
69
71
  end
70
72
 
71
73
  def inclusion_defined?(mod, inner)
72
- mod.const_defined?(inner, search_ancestors=false)
74
+ mod.const_defined?(inner, search_ancestors)
73
75
  end
74
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inclusion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Sans Collective