class FrOData::Properties::Integer

Defines the Integer FrOData type.

Public Instance Methods

type() click to toggle source

The FrOData type name

# File lib/frodata/properties/integer.rb, line 25
def type
  'Edm.Int64'
end
value() click to toggle source

Returns the property value, properly typecast @return [Integer,nil]

# File lib/frodata/properties/integer.rb, line 9
def value
  if (@value.nil? || @value.empty?) && allows_nil?
    nil
  else
    @value.to_i
  end
end
value=(new_value) click to toggle source

Sets the property value @params new_value [to_i]

# File lib/frodata/properties/integer.rb, line 19
def value=(new_value)
  validate(new_value.to_i)
  @value = new_value.to_i.to_s
end

Private Instance Methods

exponent_size() click to toggle source
# File lib/frodata/properties/integer.rb, line 31
def exponent_size
  63
end
max_value() click to toggle source
# File lib/frodata/properties/integer.rb, line 39
def max_value
  @max ||= (2**exponent_size)-1
end
min_value() click to toggle source
# File lib/frodata/properties/integer.rb, line 35
def min_value
  @min ||= -(2**exponent_size)
end