Method: MicrosoftGraph::Collection#initialize

Defined in:
lib/microsoft_graph/collection.rb

#initialize(type, initial_values = []) ⇒ Collection

Returns a new instance of Collection.



12
13
14
15
16
17
18
19
20
21
# File 'lib/microsoft_graph/collection.rb', line 12

def initialize(type, initial_values = [])
  @type = type
  @dirty = false
  @internal_values =
    if klass = MicrosoftGraph::ClassBuilder.get_namespaced_class(type.member_type.name)
      initial_values.map { |v| klass.new(attributes: v) }
    else
      initial_values
    end
end