Class: OData::Properties::Binary

Inherits:
OData::Property show all
Defined in:
lib/odata/properties/binary.rb

Overview

Defines the Binary OData type.

Instance Attribute Summary

Attributes inherited from OData::Property

#name

Instance Method Summary collapse

Methods inherited from OData::Property

#==, #allows_nil?, #concurrency_mode, #initialize, #to_xml, #xml_value

Constructor Details

This class inherits a constructor from OData::Property

Instance Method Details

#typeObject

The OData type name



23
24
25
# File 'lib/odata/properties/binary.rb', line 23

def type
  'Edm.Binary'
end

#url_valueString

Value to be used in URLs.

Returns:



29
30
31
# File 'lib/odata/properties/binary.rb', line 29

def url_value
  "binary'#{value}'"
end

#valueInteger?

Returns the property value, properly typecast

Returns:



7
8
9
10
11
12
13
# File 'lib/odata/properties/binary.rb', line 7

def value
  if (@value.nil? || @value.empty?) && allows_nil?
    nil
  else
    @value.to_i
  end
end

#value=(new_value) ⇒ Object

Sets the property value



17
18
19
20
# File 'lib/odata/properties/binary.rb', line 17

def value=(new_value)
  validate(new_value)
  @value = parse_value(new_value)
end