Class: MicrosoftGraph

Inherits:
Object
  • Object
show all
Defined in:
lib/microsoft_graph.rb,
lib/microsoft_graph/base.rb,
lib/microsoft_graph/errors.rb,
lib/microsoft_graph/version.rb,
lib/microsoft_graph/collection.rb,
lib/microsoft_graph/base_entity.rb,
lib/microsoft_graph/class_builder.rb,
lib/microsoft_graph/collection_association.rb,
lib/microsoft_graph/cached_metadata_directory.rb

Defined Under Namespace

Classes: Base, BaseEntity, ClassBuilder, Collection, CollectionAssociation, NoAssociationError, NoGraphError, NonNullableError, TypeError

Constant Summary collapse

BASE_URL =
"https://graph.microsoft.com/v1.0/"
VERSION =
"0.1.3"
CACHED_METADATA_DIRECTORY =
File.realpath(File.join(__FILE__, "../../../data/"))

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &auth_callback) ⇒ MicrosoftGraph


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/microsoft_graph.rb', line 15

def initialize(options = {}, &auth_callback)
  @service = OData::Service.new(
    api_version: options[:api_version],
    auth_callback: auth_callback,
    base_url: BASE_URL,
    metadata_file: options[:cached_metadata_file]
  )
  @association_collections = {}
  unless MicrosoftGraph::ClassBuilder.loaded?
    MicrosoftGraph::ClassBuilder.load!(service)
  end

end

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service


12
13
14
# File 'lib/microsoft_graph.rb', line 12

def service
  @service
end

Instance Method Details

#containing_navigation_property(type_name) ⇒ Object


29
30
31
32
33
# File 'lib/microsoft_graph.rb', line 29

def containing_navigation_property(type_name)
  navigation_properties.values.find do |navigation_property|
    navigation_property.collection? && navigation_property.type.name == "Collection(#{type_name})"
  end
end

#pathObject


35
# File 'lib/microsoft_graph.rb', line 35

def path; end