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.



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

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

Instance Attribute Details

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#%(n) ⇒ Object



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

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

#&(n) ⇒ Object



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

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

#*(n) ⇒ Object



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

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

#**(n) ⇒ Object



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

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

#+(n) ⇒ Object



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

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

#-(n) ⇒ Object



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

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

#/(n) ⇒ Object



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

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

#<(n) ⇒ Object



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

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

#<<(n) ⇒ Object



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

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

#<=(n) ⇒ Object



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

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

#<=>(n) ⇒ Object



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

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

#>(n) ⇒ Object



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

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

#>=(n) ⇒ Object



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

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

#>>(n) ⇒ Object



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

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

#^(n) ⇒ Object



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

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

#coerce(n) ⇒ Object



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

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

#to_fObject



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

def to_f() return @value.to_f end

#to_iObject



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

def to_i() return @value.to_i end

#to_sObject



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

def to_s() return @value.to_s end

#|(n) ⇒ Object



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

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