Class: Transifex::ResourceComponents::TranslationComponents::String

Inherits:
Object
  • Object
show all
Includes:
CrudRequests::Fetch, CrudRequests::Update, Utilities
Defined in:
lib/transifex/resource_components/translation_components/string.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CrudRequests::Update

included

Methods included from CrudRequests::Fetch

included

Constructor Details

#initialize(project_slug = nil, resource_slug = nil, translation_slug = nil, translation_key = nil, translation_context = nil) ⇒ String

Returns a new instance of String.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/transifex/resource_components/translation_components/string.rb', line 11

def initialize(project_slug = nil, resource_slug = nil, translation_slug = nil, translation_key = nil, translation_context = nil)
  raise MissingParametersError.new(["translation_key"]) if translation_key.nil?
  raise MissingParametersError.new(["translation_context"]) if translation_context.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
  @string_slug = compute_source_entity_hash(translation_key, translation_context)
end

Instance Attribute Details

#project_slugObject

Returns the value of attribute project_slug.



9
10
11
# File 'lib/transifex/resource_components/translation_components/string.rb', line 9

def project_slug
  @project_slug
end

#resource_slugObject

Returns the value of attribute resource_slug.



9
10
11
# File 'lib/transifex/resource_components/translation_components/string.rb', line 9

def resource_slug
  @resource_slug
end

#string_slugObject

Returns the value of attribute string_slug.



9
10
11
# File 'lib/transifex/resource_components/translation_components/string.rb', line 9

def string_slug
  @string_slug
end

#translation_slugObject

Returns the value of attribute translation_slug.



9
10
11
# File 'lib/transifex/resource_components/translation_components/string.rb', line 9

def translation_slug
  @translation_slug
end

Class Method Details

.authorsObject



23
24
25
# File 'lib/transifex/resource_components/translation_components/string.rb', line 23

def self.authors
  [:project, :resource, :translation]            
end