class Transifex::Resource

Attributes

category[RW]
client[RW]
i18n_type[RW]
name[RW]
slug[RW]
source_language_code[RW]

Public Class Methods

new(project_slug, transifex_data) click to toggle source
# File lib/transifex/resource.rb, line 5
def initialize(project_slug, transifex_data)
  @project_slug = project_slug
  @name = transifex_data[:name]
  @category = transifex_data[:category]
  @i18n_type = transifex_data[:i18n_type]
  @source_language_code = transifex_data[:source_language_code]
  @slug = transifex_data[:slug]
end

Public Instance Methods

content() click to toggle source
# File lib/transifex/resource.rb, line 14
def content
  client.get("/project/#{@project_slug}/resource/#{@slug}/content/")
end
stats(lang) click to toggle source
# File lib/transifex/resource.rb, line 22
def stats(lang)
  stats = client.get("/project/#{@project_slug}/resource/#{@slug}/stats/#{lang}")
  Transifex::Stats.new(stats).tap {|r| r.client = client }
end
translation(lang) click to toggle source
# File lib/transifex/resource.rb, line 18
def translation(lang)
  client.get("/project/#{@project_slug}/resource/#{@slug}/translation/#{lang}/")
end