Class: Rubyfb::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/src.rb

Overview

This class represents a Firebird generator entity.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, connection) ⇒ Generator

This is the constructor for the Generator class. Note, this method assumes that the named generator already exists. If it doesn’t then the object will be constructed but will fail during use.

Parameters

name

A string containing the generator name.

connection

A reference to the Connection object that will be used to access the generator.



1222
1223
# File 'lib/src.rb', line 1222

def initialize(name, connection)
end

Class Method Details

.create(name, connection) ⇒ Object

This method creates a new generator within a database. This method returns a Generator object is successful.

Parameters

name

A string containing the name for the new generator.

connection

A reference to the Connection object that will be used to create the generator.

Exceptions

Exception

Generated whenever a problem occurs creating the new generator in the database.



1310
1311
# File 'lib/src.rb', line 1310

def Generator.create(name, connection)
end

.exists?(name, connection) ⇒ Boolean

This method is used to determine whether a named generator exists within a database.

Parameters

name

A string containing the generator name to check for.

connection

A reference to the Connection object to be used in performing the check.

Exceptions

Exception

Generated whenever a problem occurs determining the existence of the generator.

Returns:

  • (Boolean)


1293
1294
# File 'lib/src.rb', line 1293

def Generator.exists?(name, connection)
end

Instance Method Details

#connectionObject

This is the accessor for the connection attribute.



1236
1237
# File 'lib/src.rb', line 1236

def connection
end

#dropObject

This method drops a generator from the database. After a successful call to this method the Generator object may not be used to obtain values unless it is recreated.

Exceptions

Exception

Generated whenever a problem occurs dropping the generator from the database.



1260
1261
# File 'lib/src.rb', line 1260

def drop
end

#lastObject

This method fetches the last value generator from a generator.

Exceptions

Exception

Generated whenever a problem occurs accessing the database generator.



1247
1248
# File 'lib/src.rb', line 1247

def last
end

#nameObject

This is the accessor for the name attribute.



1229
1230
# File 'lib/src.rb', line 1229

def name
end

#next(step) ⇒ Object

This method fetches the next value, depending on a specified increment, from a generator.

Parameters

step

The step interval to be applied to the generator to obtain the next value.

Exceptions

Exception

Generated whenever a problem occurs accessing the database generator.



1276
1277
# File 'lib/src.rb', line 1276

def next(step)
end