class ZOOM::Package - zoom-0.5.0 Documentation

# class ZOOM::Package

This class represents an Extended Services Package: an instruction to the server to do something not covered by the core parts of the Z39.50 standard

### Public Instance Methods

get_option(key) click to toggle source

key: the name of the option, as a string.

Gets the value of a package's option.

Returns: the value of the given option, as a string, integer or boolean.

    static VALUE
    rbz_package_get_option (VALUE self, VALUE key)
    {
            ZOOM_package package;
        const char *value;

        package = rbz_package_get (self);

        value = ZOOM_package_option_get (package,
                                            RVAL2CSTR (key));

        return zoom_option_value_to_ruby_value (value);
    }

send(type) click to toggle source

type: the actual extended service package type to be sent, as a string.

Sends the package.

Returns: self.

    static VALUE
    rbz_package_send(VALUE self, VALUE type)
    {
        ZOOM_package package;
            const char *typeChar;

        package = rbz_package_get (self);

        typeChar = StringValuePtr(type);
        ZOOM_package_send(package, typeChar);

        return self;
    }

set_option(key, value) click to toggle source

key: the name of the option, as a string.

value: the value of this option (as a string, integer or boolean).

Sets an option on the package.

Returns: self.

    static VALUE
    rbz_package_set_option (VALUE self, VALUE key, VALUE val)
    {

            ZOOM_package package;

        package = rbz_package_get (self);
        ZOOM_package_option_set (package,
                                    RVAL2CSTR (key),
                                    RVAL2CSTR (rb_obj_as_string (val)));

        return self;
    }