Method: Wordpress::OpenStruct#method_missing

Defined in:
lib/wordpress/ostruct.rb

#method_missing(method_name, *args, &block) ⇒ Object (private)



43
44
45
46
47
48
49
50
51
52
# File 'lib/wordpress/ostruct.rb', line 43

def method_missing(method_name, *args, &block)
  key = method_name.to_s
  key = key[-1] == '=' ? key[0...-1] : key
  if @hash.include?(key)
    define_accessor(key)
    send(method_name, *args, &block)
  else
    super
  end
end