Class: IDL::Type::WString
Constant Summary
Constants inherited
from IDL::Type
Long, LongLong, Octet, Short, ULong, ULongLong, UShort
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from IDL::Type
#is_complete?, #is_local?, #is_node?, #resolved_node, #resolved_type, #typeerror, #typename
Constructor Details
#initialize(size = nil) ⇒ WString
Returns a new instance of WString.
350
351
352
|
# File 'lib/ridl/type.rb', line 350
def initialize(size = nil)
@size = size
end
|
Instance Attribute Details
Returns the value of attribute size.
347
348
349
|
# File 'lib/ridl/type.rb', line 347
def size
@size
end
|
Instance Method Details
#instantiate(_context) ⇒ Object
369
370
371
|
# File 'lib/ridl/type.rb', line 369
def instantiate(_context)
self.is_template? ? Type::WString.new(@size.instantiate(_context).value) : self
end
|
#is_anonymous? ⇒ Boolean
363
364
365
|
# File 'lib/ridl/type.rb', line 363
def is_anonymous?
@size ? true : false
end
|
348
|
# File 'lib/ridl/type.rb', line 348
def length; @size; end
|
#narrow(obj) ⇒ Object
353
354
355
356
357
358
359
360
361
362
|
# File 'lib/ridl/type.rb', line 353
def narrow(obj)
typeerror(obj) unless ::Array === obj
if @size.nil?
obj
elsif @size < obj.size
typeerror(obj)
else
obj
end
end
|