Class: Zedkit::Projects

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

Defined Under Namespace

Classes: Blogs, EmailSettings, Emails, ProjectAdmins, ProjectKeys

Class Method Summary collapse

Class Method Details

.create(zks = {}, &block) ⇒ Object



41
42
43
# File 'lib/zedkit/resources/projects.rb', line 41

def create(zks = {}, &block)
  Zedkit::Client.crud(:create, "projects", zks, [], &block)
end

.delete(zks = {}, &block) ⇒ Object



49
50
51
# File 'lib/zedkit/resources/projects.rb', line 49

def delete(zks = {}, &block)
  Zedkit::Client.crud(:delete, "projects/#{zks[:uuid]}", zks, [], &block)
end

.get(zks = {}, &block) ⇒ Object

This avoids /projects/ which is a



36
37
38
39
# File 'lib/zedkit/resources/projects.rb', line 36

def get(zks = {}, &block)                                           ## This avoids /projects/[nil] which is a
  zks[:uuid] = "uuid" if zks[:uuid].nil?                            ## valid resource to list a user"s projects.
  Zedkit::Client.crud(:get, "projects/#{zks[:uuid]}", zks, [], &block)
end

.snapshot(zks = {}, &block) ⇒ Object



32
33
34
# File 'lib/zedkit/resources/projects.rb', line 32

def snapshot(zks = {}, &block)
  Zedkit::Client.get("projects/#{zks[:uuid]}/snapshot", zks[:user_key], {}, &block)
end

.update(zks = {}, &block) ⇒ Object



45
46
47
# File 'lib/zedkit/resources/projects.rb', line 45

def update(zks = {}, &block)
  Zedkit::Client.crud(:update, "projects/#{zks[:uuid]}", zks, [], &block)
end

.verify(type, key = nil) {|rs| ... } ⇒ Object

Yields:

  • (rs)


21
22
23
24
25
26
27
28
29
30
31
# File 'lib/zedkit/resources/projects.rb', line 21

def verify(type, key = nil, &block)
  rs = nil
  case type.to_sym
  when :project
    rs = Zedkit::Client.get("projects/verify", nil)
  when :locales
    rs = Zedkit::Client.get("projects/verify/locales", nil, { :locales_key => key })
  end
  yield(rs) if rs && block_given?
  rs
end