class Transifex::ResourceComponents::TranslationComponents::Strings

Attributes

project_slug[RW]
resource_slug[RW]
translation_slug[RW]

Public Class Methods

new(project_slug = nil, resource_slug = nil, translation_slug = nil) click to toggle source
# File lib/tx-ruby/resource_components/translation_components/strings.rb, line 10
def initialize(project_slug = nil, resource_slug = nil, translation_slug = nil)
  raise MissingParametersError.new(["project_slug"]) if project_slug.nil?
  raise MissingParametersError.new(["resource_slug"]) if resource_slug.nil?
  raise MissingParametersError.new(["translation_slug"]) if translation_slug.nil?
  @project_slug = project_slug
  @resource_slug = resource_slug
  @translation_slug = translation_slug
end
parents() click to toggle source
# File lib/tx-ruby/resource_components/translation_components/strings.rb, line 24
def self.parents
  [:project, :resource, :translation]            
end

Public Instance Methods

fetch_with_details(options = {}) click to toggle source
# File lib/tx-ruby/resource_components/translation_components/strings.rb, line 19
def fetch_with_details(options = {})
  options[:details] = true
  self.fetch(options)      
end
update(params) click to toggle source
Calls superclass method
# File lib/tx-ruby/resource_components/translation_components/strings.rb, line 28
def update(params)
  params = [params] unless params.is_a?(Array)
  params.each do |param|
    raise MissingParametersError.new(["key"]) unless param.key?(:key)
    param[:source_entity_hash] = compute_source_entity_hash(param[:key], param[:context])
  end
  super
end