Skip to content

Instantly share code, notes, and snippets.

@tpendragon
Created June 14, 2013 16:25
Show Gist options
  • Save tpendragon/5783296 to your computer and use it in GitHub Desktop.
Save tpendragon/5783296 to your computer and use it in GitHub Desktop.
# 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