Class: ChinoAPI

Inherits:
ChinoRuby::CheckValues show all
Defined in:
lib/chino_ruby.rb

Overview

Class which contains every Chino.io resource as objects. In this way if you create a ‘client’ variable of this class, it will contain every function for the creation, update, retrieval… of every resource. Every function is easily accessible as follow:

name_of_the_client_variable.name_of_the_resource.name_of_the_function()

Example of the creation of a Repository

@client = ChinoAPI.new(...)
@client.repositories.create_repository(...)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ChinoRuby::CheckValues

#check_boolean, #check_int, #check_json, #check_string

Constructor Details

#initialize(customer_id, customer_key, host_url) ⇒ ChinoAPI

Use this function to initialize your client variable

  • customer_id: your customer id value

  • customer_key: your customer key value

  • host_url: the url of the server, use ‘api.test.chino.io/v1’ for development and ‘api.chino.io/v1’ for the production



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/chino_ruby.rb', line 47

def initialize(customer_id, customer_key, host_url)
    check_string(customer_id)
    check_string(customer_key)
    check_string(host_url)
    @customer_id = customer_id
    @customer_key = customer_key
    @host_url = host_url
    @applications = ChinoRuby::Applications.new(@customer_id, @customer_key, @host_url)
    @auth = ChinoRuby::Auth.new(@customer_id, @customer_key, @host_url)
    @repositories = ChinoRuby::Repositories.new(@customer_id, @customer_key, @host_url)
    @schemas = ChinoRuby::Schemas.new(@customer_id, @customer_key, @host_url)
    @documents = ChinoRuby::Documents.new(@customer_id, @customer_key, @host_url)
    @user_schemas = ChinoRuby::UserSchemas.new(@customer_id, @customer_key, @host_url)
    @users = ChinoRuby::Users.new(@customer_id, @customer_key, @host_url)
    @groups = ChinoRuby::Groups.new(@customer_id, @customer_key, @host_url)
    @collections = ChinoRuby::Collections.new(@customer_id, @customer_key, @host_url)
    @permissions = ChinoRuby::Permissions.new(@customer_id, @customer_key, @host_url)
    @search = ChinoRuby::Search.new(@customer_id, @customer_key, @host_url)
    @blobs = ChinoRuby::Blobs.new(@customer_id, @customer_key, @host_url)
end

Instance Attribute Details

#applicationsObject

Returns the value of attribute applications.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def applications
  @applications
end

#authObject

Returns the value of attribute auth.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def auth
  @auth
end

#blobsObject

Returns the value of attribute blobs.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def blobs
  @blobs
end

#collectionsObject

Returns the value of attribute collections.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def collections
  @collections
end

#documentsObject

Returns the value of attribute documents.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def documents
  @documents
end

#groupsObject

Returns the value of attribute groups.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def groups
  @groups
end

#permissionsObject

Returns the value of attribute permissions.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def permissions
  @permissions
end

#repositoriesObject

Returns the value of attribute repositories.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def repositories
  @repositories
end

#schemasObject

Returns the value of attribute schemas.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def schemas
  @schemas
end

#searchObject

Returns the value of attribute search.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def search
  @search
end

#user_schemasObject

Returns the value of attribute user_schemas.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def user_schemas
  @user_schemas
end

#usersObject

Returns the value of attribute users.



41
42
43
# File 'lib/chino_ruby.rb', line 41

def users
  @users
end