Class: Arbo::Element::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/arbo/element/proxy.rb
Instance Method Summary collapse
-
#initialize(element) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to?(method, include_all = false) ⇒ Boolean
Constructor Details
#initialize(element) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 |
# File 'lib/arbo/element/proxy.rb', line 7 def initialize(element) @element = element end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/arbo/element/proxy.rb', line 19 def method_missing(method, *args, &block) if method.to_s == 'to_ary' super else @element.__send__ method, *args, &block end end |
Instance Method Details
#respond_to?(method, include_all = false) ⇒ Boolean
11 12 13 14 15 16 17 |
# File 'lib/arbo/element/proxy.rb', line 11 def respond_to?(method, include_all = false) if method.to_s == 'to_ary' false else super || @element.respond_to?(method, include_all) end end |