Class: Wordpress::Array
- Inherits:
-
Object
- Object
- Base
- OpenStruct
- Object
- Wordpress::Array
- Defined in:
- lib/wordpress/array.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #method_missing(method_name, *arguments, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Methods inherited from Object
Methods inherited from OpenStruct
#[], #[]=, #initialize, #to_s
Methods inherited from Base
Constructor Details
This class inherits a constructor from Wordpress::Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/wordpress/array.rb', line 22 def method_missing(method_name, *arguments, &block) if array_delegator.respond_to?(method_name) array_delegator.send(method_name, *arguments, &block) else super end end |
Class Method Details
.array_delegator(name) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/wordpress/array.rb', line 7 def array_delegator(name) class_eval " private\n\n def array_delegator\n \#{name}\n end\n EOS\nend\n" |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
18 19 20 |
# File 'lib/wordpress/array.rb', line 18 def respond_to_missing?(method_name, include_private = false) array_delegator.respod_to?(method_name, include_private) end |