Class: Transifex::ResourceComponents::TranslationComponents::Strings
- Inherits:
-
Object
- Object
- Transifex::ResourceComponents::TranslationComponents::Strings
- Includes:
- CrudRequests::Fetch, CrudRequests::Update, Utilities
- Defined in:
- lib/transifex/resource_components/translation_components/strings.rb
Instance Attribute Summary collapse
-
#project_slug ⇒ Object
Returns the value of attribute project_slug.
-
#resource_slug ⇒ Object
Returns the value of attribute resource_slug.
-
#translation_slug ⇒ Object
Returns the value of attribute translation_slug.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch_with_details(options = {}) ⇒ Object
-
#initialize(project_slug = nil, resource_slug = nil, translation_slug = nil) ⇒ Strings
constructor
A new instance of Strings.
- #update(params) ⇒ Object
Methods included from CrudRequests::Update
Methods included from CrudRequests::Fetch
Constructor Details
#initialize(project_slug = nil, resource_slug = nil, translation_slug = nil) ⇒ Strings
Returns a new instance of Strings.
10 11 12 13 14 15 16 17 |
# File 'lib/transifex/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 |
Instance Attribute Details
#project_slug ⇒ Object
Returns the value of attribute project_slug.
8 9 10 |
# File 'lib/transifex/resource_components/translation_components/strings.rb', line 8 def project_slug @project_slug end |
#resource_slug ⇒ Object
Returns the value of attribute resource_slug.
8 9 10 |
# File 'lib/transifex/resource_components/translation_components/strings.rb', line 8 def resource_slug @resource_slug end |
#translation_slug ⇒ Object
Returns the value of attribute translation_slug.
8 9 10 |
# File 'lib/transifex/resource_components/translation_components/strings.rb', line 8 def translation_slug @translation_slug end |
Class Method Details
.authors ⇒ Object
24 25 26 |
# File 'lib/transifex/resource_components/translation_components/strings.rb', line 24 def self. [:project, :resource, :translation] end |
Instance Method Details
#fetch_with_details(options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/transifex/resource_components/translation_components/strings.rb', line 19 def fetch_with_details( = {}) [:details] = true self.fetch() end |
#update(params) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/transifex/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 |