Class: Toptranslation::Resource::StringList
- Inherits:
-
Object
- Object
- Toptranslation::Resource::StringList
- Includes:
- Enumerable
- Defined in:
- lib/toptranslation/resource/string_list.rb
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
- #each ⇒ Object
- #find(identifier) ⇒ Object
-
#initialize(connection, options = {}) ⇒ StringList
constructor
A new instance of StringList.
Constructor Details
#initialize(connection, options = {}) ⇒ StringList
Returns a new instance of StringList.
5 6 7 8 |
# File 'lib/toptranslation/resource/string_list.rb', line 5 def initialize(connection, = {}) @connection = connection = end |
Instance Method Details
#create(options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/toptranslation/resource/string_list.rb', line 19 def create( = {}) project_identifier = ['project_identifier'] || [:project_identifier] document_identifier = ['document_identifier'] || [:document_identifier] String.new(@connection, .merge('project_identifier' => project_identifier, 'document_identifier' => document_identifier)) end |
#each ⇒ Object
15 16 17 |
# File 'lib/toptranslation/resource/string_list.rb', line 15 def each strings.each { |string| yield String.new(@connection, string) } end |
#find(identifier) ⇒ Object
10 11 12 13 |
# File 'lib/toptranslation/resource/string_list.rb', line 10 def find(identifier) result = @connection.get("/strings/#{identifier}") Document.new(@connection, result) end |