Sha256: 7323c9a5ac5a06b472f8a36431fcc88d1b1008aefdef31ef827c42bdf4d5e4cb

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

module OData
  class NavigationProperty
    attr_reader :name
    attr_reader :type
    attr_reader :nullable
    attr_reader :contain_target
    attr_reader :partner

    def initialize(options = {})
      @name           = options[:name]
      @type           = options[:type]
      @nullable       = options[:nullable].nil? ? true : false
      @contain_target = options[:contain_target] || false
      @partner        = options[:partner]
    end

    def collection?
      OData::CollectionType === type
    end

    def type_match?(value)
      type.valid_value?(value)
    end

    def collection_type_match?(value)
      collection = type
      collection.valid_value?(value)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
microsoft_graph-0.1.3 lib/odata/navigation_property.rb
microsoft_graph-0.1.1 lib/odata/navigation_property.rb
microsoft_graph-0.1.0 lib/odata/navigation_property.rb