Module: Duckface::ActsAsInterface
- Defined in:
- lib/duckface/acts_as_interface.rb
Instance Method Summary collapse
- #exclude_methods_from_interface_enforcement(*method_names) ⇒ Object
- #methods_that_should_be_implemented ⇒ Object
Instance Method Details
#exclude_methods_from_interface_enforcement(*method_names) ⇒ Object
7 8 9 |
# File 'lib/duckface/acts_as_interface.rb', line 7 def exclude_methods_from_interface_enforcement(*method_names) class_variable_set(:@@unenforced_methods, method_names) end |
#methods_that_should_be_implemented ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/duckface/acts_as_interface.rb', line 11 def methods_that_should_be_implemented expected_public_instance_methods = public_instance_methods(false) unenforced_methods = begin class_variable_get(:@@unenforced_methods) rescue NameError [] end expected_public_instance_methods - (unenforced_methods || []) end |