Class: RubyLokaliseApi::Collections::Key

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_lokalise_api/collections/key.rb

Constant Summary

Constants included from Request

Request::PAGINATION_HEADERS

Constants included from Utils::AttributeHelpers

Utils::AttributeHelpers::UNIFIED_RESOURCES

Instance Attribute Summary

Attributes inherited from Base

#branch, #client, #collection, #current_page, #path, #project_id, #request_params, #results_per_page, #team_id, #total_pages, #total_results, #user_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

all, #first_page?, #initialize, #last_page?, #next_page, #next_page?, #prev_page, #prev_page?

Methods included from BaseRequest

#delete, #get, #patch, #post, #put

Methods included from RubyLokaliseApi::Connection

#connection

Methods included from JsonHandler

#custom_dump, #custom_load

Methods included from Utils::AttributeHelpers

#attributes_for, #data_key_for, #id_key_for

Methods included from Utils::EndpointHelpers

#path_from

Constructor Details

This class inherits a constructor from RubyLokaliseApi::Collections::Base

Class Method Details

.endpoint(project_id, *_args) ⇒ Object



14
15
16
# File 'lib/ruby_lokalise_api/collections/key.rb', line 14

def endpoint(project_id, *_args)
  path_from projects: [project_id, 'keys']
end

Instance Method Details

#destroy_allHash

Destroys all keys in the collection

Returns:

  • (Hash)


8
9
10
11
# File 'lib/ruby_lokalise_api/collections/key.rb', line 8

def destroy_all
  keys = collection.map(&:key_id)
  RubyLokaliseApi::Resources::Key.destroy @client, @path, keys: keys
end