Class: Surrogate::ApiComparer::SurrogateMethods
- Inherits:
-
Struct
- Object
- Struct
- Surrogate::ApiComparer::SurrogateMethods
- Defined in:
- lib/surrogate/api_comparer.rb
Instance Attribute Summary collapse
-
#surrogate ⇒ Object
Returns the value of attribute surrogate.
Instance Method Summary collapse
- #class_api_methods ⇒ Object
-
#class_inherited_methods ⇒ Object
should have new and clone (don’t screw up substitutability because of how we implement these).
-
#class_other_methods ⇒ Object
should not have new.
- #instance_api_methods ⇒ Object
- #instance_inherited_methods ⇒ Object
- #instance_other_methods ⇒ Object
- #methods ⇒ Object
Instance Attribute Details
#surrogate ⇒ Object
Returns the value of attribute surrogate
84 85 86 |
# File 'lib/surrogate/api_comparer.rb', line 84 def surrogate @surrogate end |
Instance Method Details
#class_api_methods ⇒ Object
111 112 113 |
# File 'lib/surrogate/api_comparer.rb', line 111 def class_api_methods Set.new surrogate.singleton_class.api_method_names end |
#class_inherited_methods ⇒ Object
should have new and clone (don’t screw up substitutability because of how we implement these)
116 117 118 |
# File 'lib/surrogate/api_comparer.rb', line 116 def class_inherited_methods Set.new surrogate.singleton_class.instance_methods - surrogate.singleton_class.instance_methods(false) end |
#class_other_methods ⇒ Object
should not have new
121 122 123 |
# File 'lib/surrogate/api_comparer.rb', line 121 def class_other_methods Set.new(surrogate.singleton_class.instance_methods false) - class_api_methods - class_inherited_methods end |
#instance_api_methods ⇒ Object
99 100 101 |
# File 'lib/surrogate/api_comparer.rb', line 99 def instance_api_methods Set.new surrogate.api_method_names end |
#instance_inherited_methods ⇒ Object
103 104 105 |
# File 'lib/surrogate/api_comparer.rb', line 103 def instance_inherited_methods Set.new surrogate.instance_methods - surrogate.instance_methods(false) end |
#instance_other_methods ⇒ Object
107 108 109 |
# File 'lib/surrogate/api_comparer.rb', line 107 def instance_other_methods Set.new(surrogate.instance_methods false) - instance_api_methods end |
#methods ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/surrogate/api_comparer.rb', line 85 def methods { instance: { api: instance_api_methods, inherited: instance_inherited_methods, other: instance_other_methods, }, class: { api: class_api_methods, inherited: class_inherited_methods, other: class_other_methods, }, } end |