Class: Txgh::Config::ConfigPair

Inherits:
Object
  • Object
show all
Defined in:
lib/txgh/config/config_pair.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_config, repo_config) ⇒ ConfigPair

Returns a new instance of ConfigPair.



6
7
8
9
# File 'lib/txgh/config/config_pair.rb', line 6

def initialize(project_config, repo_config)
  @project_config = project_config
  @repo_config = repo_config
end

Instance Attribute Details

#project_configObject (readonly)

Returns the value of attribute project_config.



4
5
6
# File 'lib/txgh/config/config_pair.rb', line 4

def project_config
  @project_config
end

#repo_configObject (readonly)

Returns the value of attribute repo_config.



4
5
6
# File 'lib/txgh/config/config_pair.rb', line 4

def repo_config
  @repo_config
end

Instance Method Details

#github_apiObject



29
30
31
32
33
# File 'lib/txgh/config/config_pair.rb', line 29

def github_api
  @github_api ||= Txgh::GithubApi.create_from_credentials(
    repo_config['api_username'], repo_config['api_token']
  )
end

#github_repoObject



11
12
13
14
15
# File 'lib/txgh/config/config_pair.rb', line 11

def github_repo
  @github_repo ||= Txgh::GithubRepo.new(
    repo_config, github_api
  )
end

#transifex_apiObject



23
24
25
26
27
# File 'lib/txgh/config/config_pair.rb', line 23

def transifex_api
  @transifex_api ||= Txgh::TransifexApi.create_from_credentials(
    project_config['api_username'], project_config['api_password']
  )
end

#transifex_projectObject



17
18
19
20
21
# File 'lib/txgh/config/config_pair.rb', line 17

def transifex_project
  @transifex_project ||= Txgh::TransifexProject.new(
    project_config, transifex_api
  )
end