class IDL::Type::String
Attributes
size[R]
Public Class Methods
new(size = nil)
click to toggle source
# File lib/ridl/type.rb, line 295 def initialize(size = nil) @size = size end
Public Instance Methods
instantiate(instantiation_context)
click to toggle source
# File lib/ridl/type.rb, line 322 def instantiate(instantiation_context) self.is_template? ? (Type::String.new(@size.instantiate(instantiation_context).value)) : self end
is_anonymous?()
click to toggle source
# File lib/ridl/type.rb, line 310 def is_anonymous? @size ? true : false end
is_template?()
click to toggle source
# File lib/ridl/type.rb, line 314 def is_template? (@size && @size.is_a?(IDL::Expression) && @size.is_template?) end
length()
click to toggle source
# File lib/ridl/type.rb, line 291 def length @size end
matches?(idltype)
click to toggle source
Calls superclass method
IDL::Type#matches?
# File lib/ridl/type.rb, line 318 def matches?(idltype) super && self.size == idltype.size end
narrow(obj)
click to toggle source
# File lib/ridl/type.rb, line 299 def narrow(obj) typeerror(obj) unless ::String === obj if @size.nil? obj elsif @size < obj.size typeerror(obj) else obj end end