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.



1213
1214
# File 'lib/src.rb', line 1213

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.



1301
1302
# File 'lib/src.rb', line 1301

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)


1284
1285
# File 'lib/src.rb', line 1284

def Generator.exists?(name, connection)
end

Instance Method Details

#connectionObject

This is the accessor for the connection attribute.



1227
1228
# File 'lib/src.rb', line 1227

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.



1251
1252
# File 'lib/src.rb', line 1251

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.



1238
1239
# File 'lib/src.rb', line 1238

def last
end

#nameObject

This is the accessor for the name attribute.



1220
1221
# File 'lib/src.rb', line 1220

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.



1267
1268
# File 'lib/src.rb', line 1267

def next(step)
end