Module: DataCatalog

Defined in:
lib/base.rb,
lib/main.rb,
lib/cursor.rb,
lib/connection.rb,
lib/resources/tag.rb,
lib/resources/note.rb,
lib/resources/user.rb,
lib/resources/about.rb,
lib/resources/import.rb,
lib/resources/rating.rb,
lib/resources/report.rb,
lib/resources/source.rb,
lib/resources/api_key.rb,
lib/resources/comment.rb,
lib/resources/tagging.rb,
lib/resources/category.rb,
lib/resources/document.rb,
lib/resources/download.rb,
lib/resources/favorite.rb,
lib/resources/importer.rb,
lib/resources/broken_link.rb,
lib/resources/organization.rb,
lib/resources/categorization.rb

Defined Under Namespace

Modules: Connection Classes: About, ApiKey, ApiKeyNotConfigured, BadRequest, Base, BrokenLink, CannotDeletePrimaryApiKey, Categorization, Category, Comment, Conflict, Cursor, Document, Download, Error, Favorite, Forbidden, Import, Importer, InternalServerError, NotFound, Note, Organization, Rating, Report, Source, Tag, Tagging, Unauthorized, User

Class Method Summary collapse

Class Method Details

.api_keyObject

Accessors



22
23
24
# File 'lib/main.rb', line 22

def self.api_key
  Connection.default_params[:api_key]
end

.api_key=(key) ⇒ Object



26
27
28
# File 'lib/main.rb', line 26

def self.api_key=(key)
  Connection.default_params[:api_key] = key
end

.base_uriObject



30
31
32
# File 'lib/main.rb', line 30

def self.base_uri
  Connection.base_uri
end

.base_uri=(uri) ⇒ Object



34
35
36
37
# File 'lib/main.rb', line 34

def self.base_uri=(uri)
  u = uri.blank? ? Connection::DEFAULT_BASE_URI : uri
  Connection.base_uri(u)
end

.with_key(temp_key) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/main.rb', line 39

def self.with_key(temp_key)
  result = nil
  original_key = DataCatalog.api_key
  DataCatalog.api_key = temp_key
  result = yield
ensure
  DataCatalog.api_key = original_key
  result
end