Class: Txbr::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/txbr/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Project

Returns a new instance of Project.



8
9
10
11
12
13
14
15
16
17
# File 'lib/txbr/project.rb', line 8

def initialize(options = {})
  @braze_api_url = options.fetch(:braze_api_url)
  @braze_api_key = options.fetch(:braze_api_key)
  @handler_id = options.fetch(:handler_id)
  @strings_format = options.fetch(:strings_format)
  @source_lang = options.fetch(:source_lang)

  @braze_api = options[:braze_api]
  @transifex_api = options[:transifex_api]
end

Instance Attribute Details

#braze_api_keyObject (readonly)

Returns the value of attribute braze_api_key.



5
6
7
# File 'lib/txbr/project.rb', line 5

def braze_api_key
  @braze_api_key
end

#braze_api_urlObject (readonly)

Returns the value of attribute braze_api_url.



5
6
7
# File 'lib/txbr/project.rb', line 5

def braze_api_url
  @braze_api_url
end

#handler_idObject (readonly)

Returns the value of attribute handler_id.



5
6
7
# File 'lib/txbr/project.rb', line 5

def handler_id
  @handler_id
end

#source_langObject (readonly)

Returns the value of attribute source_lang.



6
7
8
# File 'lib/txbr/project.rb', line 6

def source_lang
  @source_lang
end

#strings_formatObject (readonly)

Returns the value of attribute strings_format.



6
7
8
# File 'lib/txbr/project.rb', line 6

def strings_format
  @strings_format
end

Instance Method Details

#braze_apiObject



19
20
21
# File 'lib/txbr/project.rb', line 19

def braze_api
  @braze_api ||= Txbr::BrazeApi.new(braze_api_key, braze_api_url)
end

#handlerObject



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

def handler
  @handler ||= Txbr.handler_for(self)
end

#transifex_apiObject



23
24
25
26
27
28
# File 'lib/txbr/project.rb', line 23

def transifex_api
  @transifex_api ||= Txgh::TransifexApi.create_from_credentials(
    Txbr::Config.transifex_api_username,
    Txbr::Config.transifex_api_password
  )
end