Module: RubyLokaliseApi::Rest::Comments

Included in:
Client
Defined in:
lib/ruby_lokalise_api/rest/comments.rb

Instance Method Summary collapse

Instance Method Details

#comment(project_id, key_id, comment_id) ⇒ RubyLokaliseApi::Resources::Comment

Returns a single comment for the given key

Parameters:

  • project_id (String)
  • key_id (String, Integer)
  • comment_id (String, Integer)

Returns:

  • (RubyLokaliseApi::Resources::Comment)

See Also:



13
14
15
# File 'lib/ruby_lokalise_api/rest/comments.rb', line 13

def comment(project_id, key_id, comment_id)
  c_r RubyLokaliseApi::Resources::KeyComment, :find, [project_id, key_id, comment_id]
end

#comments(project_id, key_id, params = {}) ⇒ RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>

Returns all comments for the given key inside the given project

Parameters:

  • project_id (String)
  • key_id (String, Integer)
  • params (Hash) (defaults to: {})

Returns:

  • (RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>)

See Also:



34
35
36
# File 'lib/ruby_lokalise_api/rest/comments.rb', line 34

def comments(project_id, key_id, params = {})
  c_r RubyLokaliseApi::Collections::KeyComment, :all, [project_id, key_id], params
end

#create_comments(project_id, key_id, params) ⇒ RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>

Creates one or more comments for the given key inside the given project

Parameters:

  • project_id (String)
  • key_id (String, Integer)
  • params (Hash, Array<Hash>)

Returns:

  • (RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>)

See Also:



45
46
47
# File 'lib/ruby_lokalise_api/rest/comments.rb', line 45

def create_comments(project_id, key_id, params)
  c_r RubyLokaliseApi::Resources::KeyComment, :create, [project_id, key_id], params, :comments
end

#destroy_comment(project_id, key_id, comment_id) ⇒ Hash

Deletes comment for the given key inside the given project

Parameters:

  • project_id (String)
  • key_id (String, Integer)
  • comment_id (String, Integer)

Returns:

  • (Hash)

See Also:



56
57
58
# File 'lib/ruby_lokalise_api/rest/comments.rb', line 56

def destroy_comment(project_id, key_id, comment_id)
  c_r RubyLokaliseApi::Resources::KeyComment, :destroy, [project_id, key_id, comment_id]
end

#project_comments(project_id, params = {}) ⇒ RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>

Returns all comments for all keys inside the given project

Parameters:

  • project_id (String)
  • params (Hash) (defaults to: {})

Returns:

  • (RubyLokaliseApi::Collection::Comment<RubyLokaliseApi::Resources::Comment>)

See Also:



23
24
25
# File 'lib/ruby_lokalise_api/rest/comments.rb', line 23

def project_comments(project_id, params = {})
  c_r RubyLokaliseApi::Collections::ProjectComment, :all, project_id, params
end