Sha256: 9c62f6cb791be239b91c075a6faabc96eec1f41577facc4f99bef6e177ef5455

Contents?: true

Size: 401 Bytes

Versions: 1

Compression:

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

1 entries across 1 versions & 1 rubygems

Version Path
microsoft_graph-0.1.2 lib/odata/types/primitive_types/guid_type.rb