Class: Qt::Integer

Inherits:
Object show all
Defined in:
lib/Qt/qtruby4.rb

Overview

Provides a mutable numeric class for passing to methods with C++ ‘int*’ or ‘int&’ arg types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n = 0) ⇒ Integer

Returns a new instance of Integer.



251
# File 'lib/Qt/qtruby4.rb', line 251

def initialize(n=0) @value = n end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



250
251
252
# File 'lib/Qt/qtruby4.rb', line 250

def value
  @value
end

Instance Method Details

#%(n) ⇒ Object



265
266
267
# File 'lib/Qt/qtruby4.rb', line 265

def %(n) 
  return Integer.new(@value % n.to_i)
end

#&(n) ⇒ Object



275
276
277
# File 'lib/Qt/qtruby4.rb', line 275

def &(n) 
  return Integer.new(@value & n.to_i)
end

#*(n) ⇒ Object



259
260
261
# File 'lib/Qt/qtruby4.rb', line 259

def *(n) 
  return Integer.new(@value * n.to_i)
end

#**(n) ⇒ Object



268
269
270
# File 'lib/Qt/qtruby4.rb', line 268

def **(n) 
  return Integer.new(@value ** n.to_i)
end

#+(n) ⇒ Object



253
254
255
# File 'lib/Qt/qtruby4.rb', line 253

def +(n) 
  return Integer.new(@value + n.to_i) 
end

#-(n) ⇒ Object



256
257
258
# File 'lib/Qt/qtruby4.rb', line 256

def -(n) 
  return Integer.new(@value - n.to_i)
end

#/(n) ⇒ Object



262
263
264
# File 'lib/Qt/qtruby4.rb', line 262

def /(n) 
  return Integer.new(@value / n.to_i)
end

#<(n) ⇒ Object



293
294
295
# File 'lib/Qt/qtruby4.rb', line 293

def <(n) 
  return @value < n.to_i
end

#<<(n) ⇒ Object



281
282
283
# File 'lib/Qt/qtruby4.rb', line 281

def <<(n) 
  return Integer.new(@value << n.to_i)
end

#<=(n) ⇒ Object



296
297
298
# File 'lib/Qt/qtruby4.rb', line 296

def <=(n) 
  return @value <= n.to_i
end

#<=>(n) ⇒ Object



300
301
302
303
304
305
306
307
308
# File 'lib/Qt/qtruby4.rb', line 300

def <=>(n)
  if @value < n.to_i
    return -1
  elsif @value > n.to_i
    return 1
  else
    return 0
  end
end

#>(n) ⇒ Object



287
288
289
# File 'lib/Qt/qtruby4.rb', line 287

def >(n) 
  return @value > n.to_i
end

#>=(n) ⇒ Object



290
291
292
# File 'lib/Qt/qtruby4.rb', line 290

def >=(n) 
  return @value >= n.to_i
end

#>>(n) ⇒ Object



284
285
286
# File 'lib/Qt/qtruby4.rb', line 284

def >>(n) 
  return Integer.new(@value >> n.to_i)
end

#^(n) ⇒ Object



278
279
280
# File 'lib/Qt/qtruby4.rb', line 278

def ^(n) 
  return Integer.new(@value ^ n.to_i)
end

#coerce(n) ⇒ Object



314
315
316
# File 'lib/Qt/qtruby4.rb', line 314

def coerce(n)
  [n, @value]
end

#to_fObject



310
# File 'lib/Qt/qtruby4.rb', line 310

def to_f() return @value.to_f end

#to_iObject



311
# File 'lib/Qt/qtruby4.rb', line 311

def to_i() return @value.to_i end

#to_sObject



312
# File 'lib/Qt/qtruby4.rb', line 312

def to_s() return @value.to_s end

#|(n) ⇒ Object



272
273
274
# File 'lib/Qt/qtruby4.rb', line 272

def |(n) 
  return Integer.new(@value | n.to_i)
end