Class: MicrosoftGraph
- Inherits:
-
Object
- Object
- MicrosoftGraph
- 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
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #containing_navigation_property(type_name) ⇒ Object
-
#initialize(options = {}, &auth_callback) ⇒ MicrosoftGraph
constructor
A new instance of MicrosoftGraph.
- #path ⇒ Object
Constructor Details
#initialize(options = {}, &auth_callback) ⇒ MicrosoftGraph
Returns a new instance of MicrosoftGraph.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/microsoft_graph.rb', line 15 def initialize( = {}, &auth_callback) @service = OData::Service.new( base_url: BASE_URL, metadata_file: [:cached_metadata_file], auth_callback: auth_callback ) @association_collections = {} unless MicrosoftGraph::ClassBuilder.loaded? MicrosoftGraph::ClassBuilder.load!(service) end end |
Instance Attribute Details
#service ⇒ Object (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
28 29 30 31 32 |
# File 'lib/microsoft_graph.rb', line 28 def (type_name) .values.find do || .collection? && .type.name == "Collection(#{type_name})" end end |
#path ⇒ Object
34 |
# File 'lib/microsoft_graph.rb', line 34 def path; end |