class Transifex::Client

Holds Transifex account credentials and projects

Attributes

request[R]

Public Class Methods

new(username, password) click to toggle source
# File lib/transifex/client.rb, line 9
def initialize(username, password)
  @request = Request.new(username, password)
  @fetched_projects = {}
end

Public Instance Methods

connection() click to toggle source
# File lib/transifex/client.rb, line 38
def connection
  request.connection
end
get(*args) click to toggle source
# File lib/transifex/client.rb, line 30
def get(*args)
  request.get(*args)
end
project(name) click to toggle source
# File lib/transifex/client.rb, line 22
def project(name)
  return @fetched_projects[name] if @fetched_projects[name]

  data = get(Paths.project(name))
  return if data == 'Not Found'
  @fetched_projects[name] = Project.new(data, self)
end
projects() click to toggle source
# File lib/transifex/client.rb, line 14
def projects
  @projects ||= begin
    get(Paths.projects).map do |project_data|
      Project.new(project_data, self)
    end
  end
end
purge_project_cache() click to toggle source
# File lib/transifex/client.rb, line 42
def purge_project_cache
  @fetched_projects = {}
end
put(*args) click to toggle source
# File lib/transifex/client.rb, line 34
def put(*args)
  request.put(*args)
end