Sha256: 81ec726eaea7536b1bb7843771728fd024b68a2bef34f5ca1153e505eabc7437

Contents?: true

Size: 425 Bytes

Versions: 3

Compression:

Stored size: 425 Bytes

Contents

module OData
  class GuidType < PrimitiveType
    def valid_value?(value)
      String === value
    end

    def coerce(value)
      case value
      when Symbol
        value.to_s
      when Numeric
        value.to_s
      when String
        value
      else
        raise TypeError, "Cannot convert #{value.inspect} into a Guid"
      end
    end

    def name
      "Edm.Guid"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
microsoft_graph-0.1.3 lib/odata/types/primitive_types/guid_type.rb
microsoft_graph-0.1.1 lib/odata/types/primitive_types/guid_type.rb
microsoft_graph-0.1.0 lib/odata/types/primitive_types/guid_type.rb