Class: IDL::Type::Boolean

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

Constant Summary collapse

Range =
[true, false]

Constants inherited from IDL::Type

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

Instance Method Summary collapse

Methods inherited from IDL::Type

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

Instance Method Details

#in_range?(val) ⇒ Boolean

Returns:



179
180
181
# File 'lib/ridl/type.rb', line 179

def in_range?(val)
  Range.include?(val)
end

#maxObject



176
177
178
# File 'lib/ridl/type.rb', line 176

def max
  true
end

#minObject



173
174
175
# File 'lib/ridl/type.rb', line 173

def min
  false
end

#narrow(obj) ⇒ Object



166
167
168
169
# File 'lib/ridl/type.rb', line 166

def narrow(obj)
  typeerror(obj) unless [TrueClass, FalseClass].include? obj.class
  obj
end

#next(val) ⇒ Object



182
183
184
# File 'lib/ridl/type.rb', line 182

def next(val)
  !val
end

#range_lengthObject



170
171
172
# File 'lib/ridl/type.rb', line 170

def range_length
  2
end