Class: MKBrut::ErbBindingDelegate
- Inherits:
-
Object
- Object
- MKBrut::ErbBindingDelegate
- Defined in:
- lib/mkbrut/erb_binding_delegate.rb
Overview
This exists because ERB can’t working with a SimpleDelegator or Delegate.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(app_options) ⇒ ErbBindingDelegate
constructor
A new instance of ErbBindingDelegate.
-
#method_missing(syn, *args, &block) ⇒ Object
Not using Delegate because it won’t work with ERB binding.
- #respond_to_missing?(syn, include_all) ⇒ Boolean
Constructor Details
#initialize(app_options) ⇒ ErbBindingDelegate
Returns a new instance of ErbBindingDelegate.
4 5 6 |
# File 'lib/mkbrut/erb_binding_delegate.rb', line 4 def initialize() = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(syn, *args, &block) ⇒ Object
Not using Delegate because it won’t work with ERB binding
9 10 11 12 13 14 15 |
# File 'lib/mkbrut/erb_binding_delegate.rb', line 9 def method_missing(syn,*args,&block) if args.empty? && .respond_to?(syn) .send(syn) else super end end |
Instance Method Details
#respond_to_missing?(syn, include_all) ⇒ Boolean
17 18 19 |
# File 'lib/mkbrut/erb_binding_delegate.rb', line 17 def respond_to_missing?(syn,include_all) .respond_to?(syn) end |