Sha256: 1a1f44d7125b06e30f9e1879f2993a42950725238be173f3cf35146f46d4a4b9

Contents?: true

Size: 561 Bytes

Versions: 5

Compression:

Stored size: 561 Bytes

Contents

require 'transifex/request'

module Transifex
  class Client
    include Transifex::Request

    def initialize(options = {})
      set_credentials(
        options[:username] || Transifex.username,
        options[:password] || Transifex.password
      )
    end

    def projects
      get('/projects/').map do |project|
        Transifex::Project.new(project).tap {|p| p.client = self }
      end
    end

    def project(slug)
      Transifex::Project.new(get("/project/#{slug}/")).tap do |project|
        project.client = self
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
transifex-ruby-0.1.0 lib/transifex/client.rb
transifex-ruby-0.0.6 lib/transifex/client.rb
transifex-ruby-0.0.5 lib/transifex/client.rb
transifex-ruby-0.0.4 lib/transifex/client.rb
transifex-ruby-fork-jg-0.1.0 lib/transifex/client.rb