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?, #matches?, #resolved_node, #resolved_type, #typeerror, #typename

Instance Method Details

#in_range?(val) ⇒ Boolean

Returns:



184
185
186
# File 'lib/ridl/type.rb', line 184

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

#maxObject



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

def max
  true
end

#minObject



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

def min
  false
end

#narrow(obj) ⇒ Object



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

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

#next(val) ⇒ Object



187
188
189
# File 'lib/ridl/type.rb', line 187

def next(val)
  !val
end

#range_lengthObject



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

def range_length
  2
end