Module: Zedkit

Defined in:
lib/zedkit/cli/text.rb,
lib/zedkit.rb,
lib/zedkit/cli/users.rb,
lib/zedkit/cli/bottom.rb,
lib/zedkit/cli/runner.rb,
lib/zedkit/cli/projects.rb,
lib/zedkit/client/client.rb,
lib/zedkit/cli/exceptions.rb,
lib/zedkit/rails/sessions.rb,
lib/zedkit/resources/blogs.rb,
lib/zedkit/resources/users.rb,
lib/zedkit/resources/emails.rb,
lib/zedkit/client/exceptions.rb,
lib/zedkit/instances/project.rb,
lib/zedkit/instances/instance.rb,
lib/zedkit/resources/projects.rb,
lib/zedkit/client/configuration.rb,
lib/zedkit/resources/blog_posts.rb,
lib/zedkit/resources/shorteners.rb,
lib/zedkit/resources/project_keys.rb,
lib/zedkit/resources/email_settings.rb,
lib/zedkit/resources/project_admins.rb,
lib/zedkit/resources/shortened_urls.rb

Overview

Copyright © Zedkit.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: CLI, Client, Sessions Classes: BlogPosts, Blogs, Configuration, EmailSettings, Emails, Instance, Project, ProjectAdmins, ProjectKeys, Projects, ShortenedUrls, Shorteners, Users, ZedkitError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Configuration

Call the configure method within an application configuration initializer to set your project key, and other goodies:

Zedkit.configure do |zb|
  zb.project_key = "from.zedkit.com.members.area"
  zb.ssl = true
end


62
63
64
# File 'lib/zedkit.rb', line 62

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



63
64
65
66
# File 'lib/zedkit.rb', line 63

def configure
  self.configuration ||= Configuration.new
  yield configuration
end

.countriesObject



28
29
30
31
32
33
34
# File 'lib/zedkit.rb', line 28

def countries
  rs = Zedkit::Client.get("entities/countries")
  if rs && block_given?
    rs.is_a?(Array) ? rs.each {|i| yield(i) } : yield(rs)
  end
  rs
end

.entitiesObject



43
44
45
46
47
48
49
# File 'lib/zedkit.rb', line 43

def entities
  rs = Zedkit::Client.get("entities/zedkit")
  if rs && block_given?
    rs.is_a?(Array) ? rs.each {|i| yield(i) } : yield(rs)
  end
  rs
end

.regions(zks = {}) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/zedkit.rb', line 35

def regions(zks = {})
  rs = Zedkit::Client.get("entities/regions", nil, zks)
  if rs && block_given?
    rs.is_a?(Array) ? rs.each {|i| yield(i) } : yield(rs)
  end
  rs
end