Module: RubyLokaliseApi::Rest::Screenshots

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/screenshots.rb

Instance Method Summary collapse

Instance Method Details

#create_screenshots(project_id, req_params) ⇒ RubyLokaliseApi::Collections::Screenshots

Creates a new order

Parameters:

  • project_id (String)
  • req_params (Hash, Array)

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/ruby_lokalise_api/rest/screenshots.rb', line 44

def create_screenshots(project_id, req_params)
  name = 'Screenshots'
  params = { query: project_id, req: req_params.to_array_obj(:screenshots) }

  data = endpoint(name: name, params: params).do_post

  collection name, data
end

#destroy_screenshot(project_id, screenshot_id) ⇒ RubyLokaliseApi::Generics::DeletedResource

Deletes a screenshot

Parameters:

  • project_id (String)
  • screenshot_id (String, Integer)

Returns:

See Also:



74
75
76
77
78
79
80
# File 'lib/ruby_lokalise_api/rest/screenshots.rb', line 74

def destroy_screenshot(project_id, screenshot_id)
  params = { query: [project_id, screenshot_id] }

  data = endpoint(name: 'Screenshots', params: params).do_delete

  RubyLokaliseApi::Generics::DeletedResource.new data.content
end

#screenshot(project_id, screenshot_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Screenshot

Returns a single screenshot

Parameters:

  • project_id (String)
  • screenshot_id (String, Integer)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



30
31
32
33
34
35
36
# File 'lib/ruby_lokalise_api/rest/screenshots.rb', line 30

def screenshot(project_id, screenshot_id, req_params = {})
  params = { query: [project_id, screenshot_id], req: req_params }

  data = endpoint(name: 'Screenshots', params: params).do_get

  resource 'Screenshot', data
end

#screenshots(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Screenshots

Returns project screenshots

Parameters:

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

Returns:

See Also:



14
15
16
17
18
19
20
21
# File 'lib/ruby_lokalise_api/rest/screenshots.rb', line 14

def screenshots(project_id, req_params = {})
  name = 'Screenshots'
  params = { query: project_id, req: req_params }

  data = endpoint(name: name, params: params).do_get

  collection name, data
end

#update_screenshot(project_id, screenshot_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Screenshot

Updates a screenshot

Parameters:

  • project_id (String)
  • screenshot_id (String, Integer)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



60
61
62
63
64
65
66
# File 'lib/ruby_lokalise_api/rest/screenshots.rb', line 60

def update_screenshot(project_id, screenshot_id, req_params = {})
  params = { query: [project_id, screenshot_id], req: req_params }

  data = endpoint(name: 'Screenshots', params: params).do_put

  resource 'Screenshot', data
end