Sha256: 37ca60f320f13833a439229a1f7afef6e3efdc589f96d6aec12b62c46a1b0b3a

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 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

1 entries across 1 versions & 1 rubygems

Version Path
microsoft_graph-0.1.2 lib/odata/navigation_property.rb