Created
June 14, 2013 16:25
-
-
Save tpendragon/5783296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connects to a Z39.50 resource and yields the connection. | |
def self.connect | |
ZOOM::Connection.open(self.endpoint, self.port) do |conn| | |
conn.database_name = self.database | |
conn.preferred_record_syntax = 'USMARC' | |
unless self.user.blank? || self.password.blank? | |
conn.set_option('user', self.user) | |
conn.set_option('password', self.password) | |
end | |
yield conn | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment