Class: Wordpress::Object::Array

Inherits:
Base
  • Object
show all
Defined in:
lib/wordpress/object/array.rb

Direct Known Subclasses

Comments, Posts

Instance Attribute Summary

Attributes inherited from Base

#client, #request

Instance Method Summary collapse

Methods inherited from Base

#assign, #initialize, options, #respond_to_missing?, #to_hash

Methods inherited from Base

#metaclass

Constructor Details

This class inherits a constructor from Wordpress::Object::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Wordpress::Object::Base

Instance Method Details

#[](k) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/wordpress/object/array.rb', line 22

def [](k)
  if k.is_a?(Fixnum) && array_name.to_s != ''
    send(array_name)[k]
  else
    send(k)
  end
end