Class: Toptranslation::Resource::String

Inherits:
Object
  • Object
show all
Defined in:
lib/toptranslation/resource/string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, options = {}) ⇒ String

Returns a new instance of String.



6
7
8
9
10
11
# File 'lib/toptranslation/resource/string.rb', line 6

def initialize(connection, options = {})
  @connection = connection
  @options = options

  update_from_response(options)
end

Instance Attribute Details

#array_indexObject

Returns the value of attribute array_index.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def array_index
  @array_index
end

#commentObject

Returns the value of attribute comment.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def comment
  @comment
end

#contextObject

Returns the value of attribute context.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def context
  @context
end

#created_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/toptranslation/resource/string.rb', line 3

def created_at
  @created_at
end

#document_identifierObject

Returns the value of attribute document_identifier.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def document_identifier
  @document_identifier
end

#identifierObject (readonly)

Returns the value of attribute identifier.



3
4
5
# File 'lib/toptranslation/resource/string.rb', line 3

def identifier
  @identifier
end

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def key
  @key
end

#locale_codeObject

Returns the value of attribute locale_code.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def locale_code
  @locale_code
end

#plural_formObject

Returns the value of attribute plural_form.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def plural_form
  @plural_form
end

#project_identifierObject

Returns the value of attribute project_identifier.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def project_identifier
  @project_identifier
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def state
  @state
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



3
4
5
# File 'lib/toptranslation/resource/string.rb', line 3

def updated_at
  @updated_at
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/toptranslation/resource/string.rb', line 4

def value
  @value
end

Instance Method Details

#saveObject



13
14
15
16
# File 'lib/toptranslation/resource/string.rb', line 13

def save
  response = @identifier ? update_remote_string : create_remote_string
  update_and_return_from_response(response)
end