class GitlabRuby::APIObject

Public Class Methods

new(data) click to toggle source
Calls superclass method
# File lib/gitlab_ruby/api_object.rb, line 3
def initialize(data)
  super()
  data.each { |key, val| self[key] = val } if data.is_a?(Hash)
end

Public Instance Methods

format(val) click to toggle source
# File lib/gitlab_ruby/api_object.rb, line 8
def format(val)
  return if val.nil?
  if val.class == Hash
    APIObject.new(val)
  else
    val
  end
end
method_missing(method, *args, &blk) click to toggle source
Calls superclass method
# File lib/gitlab_ruby/api_object.rb, line 17
def method_missing(method, *args, &blk)
  format(self[method.to_s]) || super
end
respond_to_missing?(method, include_all = false) click to toggle source
Calls superclass method
# File lib/gitlab_ruby/api_object.rb, line 21
def respond_to_missing?(method, include_all = false)
  key?(method.to_s) || super
end