Module: Behaves
- Defined in:
- lib/behaves.rb,
lib/behaves/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
Instance Method Details
#behaves_like(klass) ⇒ Object
13 14 15 16 |
# File 'lib/behaves.rb', line 13 def behaves_like(klass) add_injected_behaviors(klass) at_exit { check_for_unimplemented(klass) } end |
#implements(*methods) ⇒ Object
5 6 7 |
# File 'lib/behaves.rb', line 5 def implements(*methods) @behaviors ||= Set.new(methods) end |
#inject_behaviors(&block) ⇒ Object
9 10 11 |
# File 'lib/behaves.rb', line 9 def inject_behaviors (&block) @inject_behaviors ||= block end |