Module: ToApiInstanceMethods

Included in:
Hash
Defined in:
lib/to_api.rb

Instance Method Summary collapse

Instance Method Details

#build_to_api_include_hash(*includes) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/to_api.rb', line 11

def build_to_api_include_hash(*includes)
  include_hash = {}
  includes.each do |i|
    if i.kind_of?(Hash)
      i.each do |k,v|
        include_hash[k] = v
      end
    else
      include_hash[i] = []
    end
  end
  include_hash
end