class IDL::Type::Enum

Public Instance Methods

in_range?(val) click to toggle source
# File lib/ridl/type.rb, line 574
def in_range?(val)
  val >= self.min && val <= self.max
end
max() click to toggle source
# File lib/ridl/type.rb, line 570
def max
  @node.enumerators.length - 1
end
min() click to toggle source
# File lib/ridl/type.rb, line 566
def min
  0
end
narrow(obj) click to toggle source
# File lib/ridl/type.rb, line 556
def narrow(obj)
  typeerror(obj) unless ::Integer === obj
  typeerror(obj) unless (0...@node.enumerators.length) === obj
  obj
end
next(val) click to toggle source
# File lib/ridl/type.rb, line 578
def next(val)
  val < self.max ? val + 1 : self.min
end
range_length() click to toggle source
# File lib/ridl/type.rb, line 562
def range_length
  @node.enumerators.length
end