Module: Card::Bootstrap::Delegate
- Included in:
- Card::Bootstrap, Component, OldComponent
- Defined in:
- lib/card/bootstrap/delegate.rb
Overview
delegating methods to context
Instance Method Summary collapse
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/card/bootstrap/delegate.rb', line 5 def method_missing method_name, *args, &block # return super unless @context.respond_to? method_name if block_given? @context.send(method_name, *args, &block) else @context.send(method_name, *args) end end |
Instance Method Details
#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
14 15 16 |
# File 'lib/card/bootstrap/delegate.rb', line 14 def respond_to_missing? method_name, _include_private=false @context.respond_to? method_name end |