Class: IDL::Type::Char

Inherits:
IDL::Type show all
Defined in:
lib/ridl/type.rb

Constant Summary

Constants inherited from IDL::Type

Long, LongLong, Octet, Short, TinyShort, ULong, ULongLong, UShort, UTinyShort

Instance Method Summary collapse

Methods inherited from IDL::Type

#instantiate, #is_anonymous?, #is_complete?, #is_local?, #is_node?, #is_template?, #matches?, #resolved_node, #resolved_type, #typeerror, #typename

Instance Method Details

#in_range?(val) ⇒ Boolean

Returns:



247
248
249
# File 'lib/ridl/type.rb', line 247

def in_range?(val)
  val >= self.min && val <= self.max
end

#maxObject



251
252
253
# File 'lib/ridl/type.rb', line 251

def max
  255
end

#minObject



243
244
245
# File 'lib/ridl/type.rb', line 243

def min
  0
end

#narrow(obj) ⇒ Object



233
234
235
236
237
# File 'lib/ridl/type.rb', line 233

def narrow(obj)
  typeerror(obj) unless ::Integer === obj
  typeerror(obj) unless (0..255) === obj
  obj
end

#next(val) ⇒ Object



255
256
257
# File 'lib/ridl/type.rb', line 255

def next(val)
  val < self.max ? val + 1 : self.min
end

#range_lengthObject



239
240
241
# File 'lib/ridl/type.rb', line 239

def range_length
  256
end