Class: Zedkit::Projects::Locales

Inherits:
Object
  • Object
show all
Defined in:
lib/zedlocales/projects.rb

Class Method Summary collapse

Class Method Details

.create(*args) {|reshh| ... } ⇒ Object

Yields:

  • (reshh)


40
41
42
43
44
45
46
# File 'lib/zedlocales/projects.rb', line 40

def create(*args)
  zopts = args.extract_zedkit_options!
  reshh = Zedkit::Client.create("projects/#{zopts[:project][:uuid]}/locales", zopts[:user_key],
                                                     zopts.zdelete_keys!(%w(user_key project)))
  yield(reshh) if (not reshh.nil?) && block_given?
  reshh
end

.delete(*args) {|reshh| ... } ⇒ Object

Yields:

  • (reshh)


56
57
58
59
60
61
62
# File 'lib/zedlocales/projects.rb', line 56

def delete(*args)
  zopts = args.extract_zedkit_options!
  reshh = Zedkit::Client.delete("projects/#{zopts[:project][:uuid]}/locales/#{zopts[:locale][:code]}",
                                                                                     zopts[:user_key])
  yield(reshh) if (not reshh.nil?) && block_given?
  reshh
end

.get(*args) {|reshh| ... } ⇒ Object

Yields:

  • (reshh)


33
34
35
36
37
38
# File 'lib/zedlocales/projects.rb', line 33

def get(*args)
  zopts = args.extract_zedkit_options!
  reshh = Zedkit::Client.get("projects/#{zopts[:project][:uuid]}/locales", zopts[:user_key])
  yield(reshh) if (not reshh.nil?) && block_given?
  reshh
end

.update(*args) {|reshh| ... } ⇒ Object

Yields:

  • (reshh)


48
49
50
51
52
53
54
# File 'lib/zedlocales/projects.rb', line 48

def update(*args)
  zopts = args.extract_zedkit_options!
  reshh = Zedkit::Client.update("projects/#{zopts[:project][:uuid]}/locales/#{zopts[:locale][:code]}",
                                          zopts[:user_key], zopts.zdelete_keys!(%w(user_key project)))
  yield(reshh) if (not reshh.nil?) && block_given?
  reshh
end