Class: OData::GuidType

Inherits:
PrimitiveType show all
Defined in:
lib/odata/types/primitive_types/guid_type.rb

Instance Method Summary collapse

Methods inherited from Type

#collection?, #initialize

Constructor Details

This class inherits a constructor from OData::Type

Instance Method Details

#coerce(value) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/odata/types/primitive_types/guid_type.rb', line 7

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

#nameObject


20
21
22
# File 'lib/odata/types/primitive_types/guid_type.rb', line 20

def name
  "Edm.Guid"
end

#valid_value?(value) ⇒ Boolean


3
4
5
# File 'lib/odata/types/primitive_types/guid_type.rb', line 3

def valid_value?(value)
  String === value
end