Class: OracleDB::VersionInfo

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/oracledb/info_types.rb,
ext/oracledb/rboradb_info_types.c

Instance Method Summary collapse

Constructor Details

#initialize(version, release = 0, update = 0, port_release = 0, port_update = 0) ⇒ VersionInfo

Returns a new instance of VersionInfo.



233
234
235
236
237
238
239
# File 'lib/oracledb/info_types.rb', line 233

def initialize(version, release=0, update=0, port_release=0, port_update=0)
  @version = version
  @release = release
  @update = update
  @port_release = port_release
  @port_update = port_update
end

Instance Method Details

#<=>(other) ⇒ Object



269
270
271
272
273
274
275
276
# File 'lib/oracledb/info_types.rb', line 269

def <=>(other)
  result = self.version <=> other.version
  result = self.release <=> other.release if result == 0
  result = self.update <=> other.update if result == 0
  result = self.port_release <=> other.port_release if result == 0
  result = self.port_update <=> other.port_update if result == 0
  result
end

#inspectObject



265
266
267
# File 'lib/oracledb/info_types.rb', line 265

def inspect
  "#<#{self.class.to_s}: #{self.to_s}>"
end

#port_releaseObject



253
254
255
# File 'lib/oracledb/info_types.rb', line 253

def port_release
  @port_release
end

#port_updateObject



257
258
259
# File 'lib/oracledb/info_types.rb', line 257

def port_update
  @port_update
end

#releaseObject



245
246
247
# File 'lib/oracledb/info_types.rb', line 245

def release
  @release
end

#to_sObject



261
262
263
# File 'lib/oracledb/info_types.rb', line 261

def to_s
  "#{@version}.#{@release}.#{@update}.#{@port_release}.#{@port_update}"
end

#updateObject



249
250
251
# File 'lib/oracledb/info_types.rb', line 249

def update
  @update
end

#versionObject



241
242
243
# File 'lib/oracledb/info_types.rb', line 241

def version
  @version
end