Method: Gitlab::ObjectifiedHash#method_missing

Defined in:
lib/gitlab/objectified_hash.rb

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

Respond to messages for which ‘self.data` has a key


36
37
38
39
40
41
42
43
44
45
# File 'lib/gitlab/objectified_hash.rb', line 36

def method_missing(method_name, *args, &block)
  if data.key?(method_name.to_s)
    data[method_name.to_s]
  elsif data.respond_to?(method_name)
    warn 'WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.'
    data.send(method_name, *args, &block)
  else
    super
  end
end