striuct 0.6.1 → 0.9.0

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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE.txt +21 -0
  3. data/README.md +44 -60
  4. data/lib/striuct/{requirements.rb → bootstrap.rb} +6 -2
  5. data/lib/striuct/classmethods/README.md +2 -2
  6. data/lib/striuct/classmethods/adjustment.rb +77 -13
  7. data/lib/striuct/classmethods/attributes.rb +94 -92
  8. data/lib/striuct/classmethods/conflict_management.rb +109 -106
  9. data/lib/striuct/classmethods/constructor.rb +55 -65
  10. data/lib/striuct/classmethods/copy.rb +45 -43
  11. data/lib/striuct/classmethods/default.rb +23 -21
  12. data/lib/striuct/classmethods/enum.rb +46 -44
  13. data/lib/striuct/classmethods/fix.rb +23 -21
  14. data/lib/striuct/classmethods/hashdeepdupulicatable.rb +15 -15
  15. data/lib/striuct/classmethods/inner.rb +57 -55
  16. data/lib/striuct/classmethods/length.rb +12 -10
  17. data/lib/striuct/classmethods/macro.rb +99 -106
  18. data/lib/striuct/classmethods/names.rb +69 -65
  19. data/lib/striuct/classmethods/predicate.rb +131 -129
  20. data/lib/striuct/classmethods/requirements.rb +2 -2
  21. data/lib/striuct/classmethods/to_struct.rb +21 -18
  22. data/lib/striuct/classmethods/validation.rb +15 -13
  23. data/lib/striuct/instancemethods/README.md +2 -2
  24. data/lib/striuct/instancemethods/assign.rb +29 -27
  25. data/lib/striuct/instancemethods/cast.rb +28 -26
  26. data/lib/striuct/instancemethods/compare.rb +26 -24
  27. data/lib/striuct/instancemethods/default.rb +31 -29
  28. data/lib/striuct/instancemethods/delegate_class_methods.rb +35 -33
  29. data/lib/striuct/instancemethods/enum.rb +86 -84
  30. data/lib/striuct/instancemethods/getter.rb +39 -37
  31. data/lib/striuct/instancemethods/hashy.rb +99 -97
  32. data/lib/striuct/instancemethods/lock.rb +46 -44
  33. data/lib/striuct/instancemethods/object.rb +50 -48
  34. data/lib/striuct/instancemethods/requirements.rb +9 -13
  35. data/lib/striuct/instancemethods/safety.rb +11 -9
  36. data/lib/striuct/instancemethods/setter.rb +46 -45
  37. data/lib/striuct/instancemethods/to_s.rb +39 -37
  38. data/lib/striuct/instancemethods/validation.rb +46 -29
  39. data/lib/striuct/instancemethods/values.rb +50 -48
  40. data/lib/striuct/singleton_class.rb +25 -18
  41. data/lib/striuct/structs.rb +3 -3
  42. data/lib/striuct.rb +7 -3
  43. metadata +18 -209
  44. data/.gitignore +0 -35
  45. data/.travis.yml +0 -17
  46. data/.yardopts +0 -1
  47. data/Gemfile +0 -11
  48. data/MIT-LICENSE +0 -22
  49. data/Rakefile +0 -11
  50. data/benchmark/basics.rb +0 -56
  51. data/example/README.rb +0 -50
  52. data/example/example1.rb +0 -195
  53. data/example/example2.rb +0 -20
  54. data/example/see_trace.rb +0 -32
  55. data/lib/striuct/instancemethods/keyvalidatable.rb +0 -9
  56. data/striuct.gemspec +0 -45
  57. data/test/helper.rb +0 -3
  58. data/test/test_sglc-constructor.rb +0 -36
  59. data/test/test_subc-c-add_members.rb +0 -13
  60. data/test/test_subc-c-close_member.rb +0 -36
  61. data/test/test_subc-c-constructor.rb +0 -92
  62. data/test/test_subc-c-copy.rb +0 -71
  63. data/test/test_subc-c-freeze.rb +0 -36
  64. data/test/test_subc-c-inheritable.rb +0 -58
  65. data/test/test_subc-c-safety_naming.rb +0 -73
  66. data/test/test_subc-f-alias_member.rb +0 -54
  67. data/test/test_subc-f-enum.rb +0 -159
  68. data/test/test_subc-f-predicate.rb +0 -647
  69. data/test/test_subc-f-to_struct.rb +0 -61
  70. data/test/test_subc-f-validation_util.rb +0 -59
  71. data/test/test_subc-f_debug.rb +0 -39
  72. data/test/test_subc-f_name.rb +0 -525
  73. data/test/test_subc-i-accessor.rb +0 -138
  74. data/test/test_subc-i-adjuster.rb +0 -95
  75. data/test/test_subc-i-assign.rb +0 -53
  76. data/test/test_subc-i-basic.rb +0 -43
  77. data/test/test_subc-i-cast.rb +0 -27
  78. data/test/test_subc-i-compare.rb +0 -52
  79. data/test/test_subc-i-copy.rb +0 -23
  80. data/test/test_subc-i-default_value.rb +0 -129
  81. data/test/test_subc-i-freeze.rb +0 -19
  82. data/test/test_subc-i-hashlike.rb +0 -144
  83. data/test/test_subc-i-keyvalidatable.rb +0 -25
  84. data/test/test_subc-i-lock.rb +0 -40
  85. data/test/test_subc-i-must.rb +0 -30
  86. data/test/test_subc-i-to_s_family.rb +0 -26
  87. data/test/test_subc-i-validation_specific_conditions.rb +0 -297
  88. data/test/test_subc-i-validation_with_getter.rb +0 -33
  89. data/test/test_version.rb +0 -13
@@ -1,130 +1,132 @@
1
- class Striuct; module ClassMethods
2
-
3
- # @group Basic Predicate
4
-
5
- # @param [Symbol, String, #to_sym] name
6
- def has_autonym?(name)
7
- name = name.to_sym
8
- rescue NoMethodError
9
- false
10
- else
11
- @autonyms.include? name
12
- end
13
-
14
- alias_method :autonym?, :has_autonym?
15
-
16
- # @param [Symbol, String, #to_sym] als
17
- def has_alias?(als)
18
- als = als.to_sym
19
- rescue NoMethodError
20
- false
21
- else
22
- @aliases.has_key? als
23
- end
24
-
25
- alias_method :alias?, :has_alias?
26
- alias_method :aliased?, :has_alias? # obsolute
27
-
28
- # @param [Symbol, String, #to_sym] name
29
- def has_member?(name)
30
- autonym_for_member name
31
- rescue Exception
32
- false
33
- else
34
- true
35
- end
36
-
37
- alias_method :member?, :has_member?
38
-
39
- # @param [Integer, #to_int] index
40
- def has_index?(index)
41
- @autonyms.fetch index
42
- rescue Exception
43
- false
44
- else
45
- true
46
- end
47
-
48
- alias_method :index?, :has_index?
49
-
50
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
51
- def has_key?(key)
52
- has_member?(key) || has_index?(key)
53
- end
54
-
55
- alias_method :key?, :has_key?
56
-
57
- # @param [Symbol, String, #to_sym] autonym
58
- def with_aliases?(autonym)
59
- autonym = autonym.to_sym
60
- rescue NoMethodError
61
- false
62
- else
63
- @aliases.has_value? autonym
1
+ # frozen_string_literal: true
2
+
3
+ class Striuct
4
+ module ClassMethods
5
+ # @group Basic Predicate
6
+
7
+ # @param [Symbol, String, #to_sym] name
8
+ def has_autonym?(name)
9
+ name = name.to_sym
10
+ rescue NoMethodError
11
+ false
12
+ else
13
+ @autonyms.include?(name)
14
+ end
15
+
16
+ alias_method :autonym?, :has_autonym?
17
+
18
+ # @param [Symbol, String, #to_sym] als
19
+ def has_alias?(als)
20
+ als = als.to_sym
21
+ rescue NoMethodError
22
+ false
23
+ else
24
+ @aliases.key?(als)
25
+ end
26
+
27
+ alias_method :alias?, :has_alias?
28
+ alias_method :aliased?, :has_alias? # obsolete
29
+
30
+ # @param [Symbol, String, #to_sym] name
31
+ def has_member?(name)
32
+ autonym_for_member(name)
33
+ rescue Exception
34
+ false
35
+ else
36
+ true
37
+ end
38
+
39
+ alias_method :member?, :has_member?
40
+
41
+ # @param [Integer, #to_int] index
42
+ def has_index?(index)
43
+ @autonyms.fetch(index)
44
+ rescue Exception
45
+ false
46
+ else
47
+ true
48
+ end
49
+
50
+ alias_method :index?, :has_index?
51
+
52
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
53
+ def has_key?(key)
54
+ has_member?(key) || has_index?(key)
55
+ end
56
+
57
+ alias_method :key?, :has_key?
58
+
59
+ # @param [Symbol, String, #to_sym] autonym
60
+ def with_aliases?(autonym)
61
+ autonym = autonym.to_sym
62
+ rescue NoMethodError
63
+ false
64
+ else
65
+ @aliases.value?(autonym)
66
+ end
67
+
68
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
69
+ def with_default?(key)
70
+ autonym = autonym_for_key(key)
71
+ rescue Exception
72
+ false
73
+ else
74
+ _attributes_for(autonym).with_default?
75
+ end
76
+
77
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
78
+ def with_condition?(key)
79
+ autonym = autonym_for_key(key)
80
+ rescue Exception
81
+ false
82
+ else
83
+ _attributes_for(autonym).with_condition?
84
+ end
85
+
86
+ alias_method :restrict?, :with_condition?
87
+
88
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
89
+ def with_must?(key)
90
+ autonym = autonym_for_key(key)
91
+ rescue Exception
92
+ false
93
+ else
94
+ _attributes_for(autonym).with_must?
95
+ end
96
+
97
+ alias_method :must?, :with_must?
98
+
99
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
100
+ def with_safety_getter?(key)
101
+ autonym = autonym_for_key(key)
102
+ rescue Exception
103
+ false
104
+ else
105
+ _attributes_for(autonym).with_safety_getter?
106
+ end
107
+
108
+ alias_method :with_safety_reader?, :with_safety_getter?
109
+
110
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
111
+ def with_safety_setter?(key)
112
+ autonym = autonym_for_key(key)
113
+ rescue Exception
114
+ false
115
+ else
116
+ _attributes_for(autonym).with_safety_setter?
117
+ end
118
+
119
+ alias_method :with_safety_writer?, :with_safety_setter?
120
+
121
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
122
+ def with_adjuster?(key)
123
+ autonym = autonym_for_key(key)
124
+ rescue Exception
125
+ false
126
+ else
127
+ _attributes_for(autonym).with_adjuster?
128
+ end
129
+
130
+ # @endgroup
64
131
  end
65
-
66
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
67
- def with_default?(key)
68
- autonym = autonym_for_key key
69
- rescue Exception
70
- false
71
- else
72
- _attributes_for(autonym).with_default?
73
- end
74
-
75
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
76
- def with_condition?(key)
77
- autonym = autonym_for_key key
78
- rescue Exception
79
- false
80
- else
81
- _attributes_for(autonym).with_condition?
82
- end
83
-
84
- alias_method :restrict?, :with_condition?
85
-
86
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
87
- def with_must?(key)
88
- autonym = autonym_for_key key
89
- rescue Exception
90
- false
91
- else
92
- _attributes_for(autonym).with_must?
93
- end
94
-
95
- alias_method :must?, :with_must?
96
-
97
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
98
- def with_safety_getter?(key)
99
- autonym = autonym_for_key key
100
- rescue Exception
101
- false
102
- else
103
- _attributes_for(autonym).with_safety_getter?
104
- end
105
-
106
- alias_method :with_safety_reader?, :with_safety_getter?
107
-
108
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
109
- def with_safety_setter?(key)
110
- autonym = autonym_for_key key
111
- rescue Exception
112
- false
113
- else
114
- _attributes_for(autonym).with_safety_setter?
115
- end
116
-
117
- alias_method :with_safety_writer?, :with_safety_setter?
118
-
119
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
120
- def with_adjuster?(key)
121
- autonym = autonym_for_key key
122
- rescue Exception
123
- false
124
- else
125
- _attributes_for(autonym).with_adjuster?
126
- end
127
-
128
- # @endgroup
129
-
130
- end; end
132
+ end
@@ -1,4 +1,4 @@
1
- require 'optionalargument'
1
+ # frozen_string_literal: true
2
2
 
3
3
  require_relative 'hashdeepdupulicatable'
4
4
  require_relative 'attributes'
@@ -15,4 +15,4 @@ require_relative 'default'
15
15
  require_relative 'adjustment'
16
16
  require_relative 'macro'
17
17
  require_relative 'conflict_management'
18
- require_relative 'validation'
18
+ require_relative 'validation'
@@ -1,24 +1,27 @@
1
- class Striuct; module ClassMethods
1
+ # frozen_string_literal: true
2
2
 
3
- # @group To Ruby's Struct Class
3
+ class Striuct
4
+ module ClassMethods
5
+ # @group To Ruby's Struct Class
4
6
 
5
- # @return [Class]
6
- def to_struct_class
7
- raise 'No defined members' if autonyms.empty?
7
+ # @return [Class]
8
+ def to_struct_class
9
+ raise 'No defined members' if autonyms.empty?
8
10
 
9
- struct_cls = ::Struct.new(*autonyms)
10
- return struct_cls unless name
11
+ struct_cls = ::Struct.new(*autonyms)
12
+ return struct_cls unless name
11
13
 
12
- const_suffix = name.slice(/[^:]+\z/).to_sym
13
- if ::Striuct::Structs.const_defined?(const_suffix, false) &&
14
- (already_cls = ::Striuct::Structs.const_get(const_suffix, false)).members == autonyms
15
- raise unless already_cls.superclass.equal? Struct
16
- already_cls
17
- else
18
- ::Striuct::Structs.const_set const_suffix, struct_cls
19
- end
20
- end
14
+ const_suffix = name.slice(/[^:]+\z/).to_sym
15
+ if ::Striuct::Structs.const_defined?(const_suffix, false) &&
16
+ (already_cls = ::Striuct::Structs.const_get(const_suffix, false)).members == autonyms
17
+ raise unless already_cls.superclass.equal?(Struct)
21
18
 
22
- # @endgroup
19
+ already_cls
20
+ else
21
+ ::Striuct::Structs.const_set(const_suffix, struct_cls)
22
+ end
23
+ end
23
24
 
24
- end; end
25
+ # @endgroup
26
+ end
27
+ end
@@ -1,15 +1,17 @@
1
- class Striuct; module ClassMethods
2
-
3
- # @group Validation
4
-
5
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
6
- def condition_for(key)
7
- autonym = autonym_for_key key
8
- raise KeyError unless with_condition? autonym
9
-
10
- _attributes_for(autonym).condition
11
- end
1
+ # frozen_string_literal: true
2
+
3
+ class Striuct
4
+ module ClassMethods
5
+ # @group Validation
12
6
 
13
- # @endgroup
7
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
8
+ def condition_for(key)
9
+ autonym = autonym_for_key(key)
10
+ raise KeyError unless with_condition?(autonym)
14
11
 
15
- end; end
12
+ _attributes_for(autonym).condition
13
+ end
14
+
15
+ # @endgroup
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  Note
2
2
  =====
3
3
 
4
- This dir's tree is diveded under roles/features.
5
- Not under CONSTANT names.
4
+ This dir's tree is divided under roles/features.
5
+ Not under CONSTANT names.
@@ -1,33 +1,35 @@
1
- class Striuct; module InstanceMethods
1
+ # frozen_string_literal: true
2
2
 
3
- # @group Assign / Unassign
4
-
5
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
6
- def assigned?(key)
7
- @db.has_key? autonym_for_key(key)
8
- end
3
+ class Striuct
4
+ module InstanceMethods
5
+ # @group Assign / Unassign
9
6
 
10
- alias_method :assign?, :assigned?
11
-
12
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
13
- # @return value / nil - value assigned under the key
14
- def unassign(key)
15
- _check_frozen
16
- _check_locked key
17
- if must? key
18
- raise InvalidOperationError, "`#{key}` require a value under `must` option"
7
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
8
+ def assigned?(key)
9
+ @db.key?(autonym_for_key(key))
19
10
  end
20
-
21
- @db.delete autonym_for_key(key)
22
- end
23
-
24
- alias_method :delete_at, :unassign
25
11
 
26
- # true if all members are not yet assigned
27
- def empty?
28
- _autonyms.none?{|autonym|@db.has_key? autonym}
29
- end
12
+ alias_method :assign?, :assigned?
30
13
 
31
- # @endgroup
14
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
15
+ # @return value / nil - value assigned under the key
16
+ def unassign(key)
17
+ _check_frozen
18
+ _check_locked(key)
19
+ if must?(key)
20
+ raise InvalidOperationError, "`#{key}` require a value under `must` option"
21
+ end
22
+
23
+ @db.delete(autonym_for_key(key))
24
+ end
32
25
 
33
- end; end
26
+ alias_method :delete_at, :unassign
27
+
28
+ # true if all members are not yet assigned
29
+ def empty?
30
+ _autonyms.none? { |autonym| @db.key?(autonym) }
31
+ end
32
+
33
+ # @endgroup
34
+ end
35
+ end
@@ -1,32 +1,34 @@
1
- class Striuct; module InstanceMethods
1
+ # frozen_string_literal: true
2
2
 
3
- # @group Cast
3
+ class Striuct
4
+ module InstanceMethods
5
+ # @group Cast
4
6
 
5
- # @return [self]
6
- def to_striuct
7
- self
8
- end
7
+ # @return [self]
8
+ def to_striuct
9
+ self
10
+ end
9
11
 
10
- # @return [Struct]
11
- def to_struct
12
- self.class.to_struct_class.new(*values)
13
- end
14
-
15
- # @param [Boolean] include_no_assign
16
- # @return [Hash]
17
- def to_h(include_no_assign=true)
18
- return @db.dup unless include_no_assign
12
+ # @return [Struct]
13
+ def to_struct
14
+ self.class.to_struct_class.new(*values)
15
+ end
19
16
 
20
- Hash[each_pair.to_a]
21
- end
22
-
23
- # @return [Array]
24
- def values
25
- each_value.to_a
26
- end
27
-
28
- alias_method :to_a, :values
17
+ # @param [Boolean] include_no_assign
18
+ # @return [Hash]
19
+ def to_h(include_no_assign: true)
20
+ return @db.dup unless include_no_assign
29
21
 
30
- # @endgroup
22
+ each_pair.to_a.to_h
23
+ end
31
24
 
32
- end; end
25
+ # @return [Array]
26
+ def values
27
+ each_value.to_a
28
+ end
29
+
30
+ alias_method :to_a, :values
31
+
32
+ # @endgroup
33
+ end
34
+ end
@@ -1,30 +1,32 @@
1
- class Striuct; module InstanceMethods
2
-
3
- # @group Compare with other
4
-
5
- # @return [Boolean]
6
- def ==(other)
7
- other.instance_of?(self.class) &&
8
- each_pair.all?{|autonym, val|other._get(autonym) == val}
9
- end
1
+ # frozen_string_literal: true
10
2
 
11
- alias_method :===, :==
12
-
13
- def eql?(other)
14
- other.instance_of?(self.class) && other._db.eql?(@db)
15
- end
3
+ class Striuct
4
+ module InstanceMethods
5
+ # @group Compare with other
16
6
 
17
- # @return [Integer]
18
- def hash
19
- @db.hash
20
- end
7
+ # @return [Boolean]
8
+ def ==(other)
9
+ other.instance_of?(self.class) &&
10
+ each_pair.all? { |autonym, val| other._get(autonym) == val }
11
+ end
21
12
 
22
- protected
13
+ alias_method :===, :==
23
14
 
24
- def _db
25
- @db
26
- end
15
+ def eql?(other)
16
+ other.instance_of?(self.class) && other._db.eql?(@db)
17
+ end
27
18
 
28
- # @endgroup
19
+ # @return [Integer]
20
+ def hash
21
+ @db.hash
22
+ end
29
23
 
30
- end; end
24
+ protected
25
+
26
+ def _db
27
+ @db
28
+ end
29
+
30
+ # @endgroup
31
+ end
32
+ end
@@ -1,36 +1,38 @@
1
- class Striuct; module InstanceMethods
1
+ # frozen_string_literal: true
2
2
 
3
- # @group Default Value
4
-
5
- # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
6
- def default?(key)
7
- autonym = autonym_for_key key
3
+ class Striuct
4
+ module InstanceMethods
5
+ # @group Default Value
8
6
 
9
- default_value_for(autonym) == fetch_by_autonym(autonym)
10
- end
7
+ # @param [Symbol, String, #to_sym, Integer, #to_int] key - name / index
8
+ def default?(key)
9
+ autonym = autonym_for_key(key)
10
+
11
+ default_value_for(autonym) == fetch_by_autonym(autonym)
12
+ end
11
13
 
12
- private
14
+ private
13
15
 
14
- # @param [Symbol] target_autonyms - MUST already converted to native autonym
15
- # @return [self]
16
- def _set_defaults(*target_autonyms)
17
- target_autonyms.each do |autonym|
18
- if with_default? autonym
19
- default = default_value_for autonym
20
- _set autonym, (
21
- if default_type_for(autonym) == :lazy
22
- args = [self, autonym][0, default.arity]
23
- default.call(*args)
24
- else
25
- default
26
- end
27
- )
16
+ # @param [Symbol] target_autonyms - MUST already converted to native autonym
17
+ # @return [self]
18
+ def _set_defaults(*target_autonyms)
19
+ target_autonyms.each do |autonym|
20
+ if with_default?(autonym)
21
+ default = default_value_for(autonym)
22
+ _set(autonym, (
23
+ if default_type_for(autonym) == :lazy
24
+ args = [self, autonym][0, default.arity]
25
+ default.call(*args)
26
+ else
27
+ default
28
+ end
29
+ ))
30
+ end
28
31
  end
29
- end
30
-
31
- self
32
- end
33
32
 
34
- # @endgroup
33
+ self
34
+ end
35
35
 
36
- end; end
36
+ # @endgroup
37
+ end
38
+ end
@@ -1,37 +1,39 @@
1
- class Striuct; module InstanceMethods
1
+ # frozen_string_literal: true
2
2
 
3
- # @group Delegate Class Methods
4
-
5
- def_delegators :'self.class',
6
- :autonym_for_alias,
7
- :autonym_for_member,
8
- :autonym_for_index,
9
- :autonym_for_key,
10
- :autonyms, :members, :all_members, :aliases, :attributes,
11
- :has_autonym?, :autonym?,
12
- :has_alias?, :alias?, :aliased?,
13
- :has_member?, :member?,
14
- :has_index?, :index?,
15
- :has_key?, :key?,
16
- :with_aliases?,
17
- :aliases_for_autonym,
18
- :length, :size,
19
- :with_condition?, :restrict?,
20
- :condition_for,
21
- :with_safety_getter?, :with_safety_reader?,
22
- :with_safety_setter?, :with_safety_writer?,
23
- :with_must?, :must?,
24
- :with_default?,
25
- :default_value_for, :default_type_for,
26
- :with_adjuster?,
27
- :adjuster_for
3
+ class Striuct
4
+ module InstanceMethods
5
+ # @group Delegate Class Methods
28
6
 
29
- private
7
+ def_delegators :'self.class',
8
+ :autonym_for_alias,
9
+ :autonym_for_member,
10
+ :autonym_for_index,
11
+ :autonym_for_key,
12
+ :autonyms, :members, :all_members, :aliases, :attributes,
13
+ :has_autonym?, :autonym?,
14
+ :has_alias?, :alias?, :aliased?,
15
+ :has_member?, :member?,
16
+ :has_index?, :index?,
17
+ :has_key?, :key?,
18
+ :with_aliases?,
19
+ :aliases_for_autonym,
20
+ :length, :size,
21
+ :with_condition?, :restrict?,
22
+ :condition_for,
23
+ :with_safety_getter?, :with_safety_reader?,
24
+ :with_safety_setter?, :with_safety_writer?,
25
+ :with_must?, :must?,
26
+ :with_default?,
27
+ :default_value_for, :default_type_for,
28
+ :with_adjuster?,
29
+ :adjuster_for
30
30
 
31
- def _autonyms
32
- self.class.__send__ :_autonyms
33
- end
31
+ private
32
+
33
+ def _autonyms
34
+ self.class.__send__(:_autonyms)
35
+ end
34
36
 
35
- # @endgroup
36
-
37
- end; end
37
+ # @endgroup
38
+ end
39
+ end