Module: Zaikio::Directory
- Defined in:
- lib/zaikio/directory.rb,
lib/zaikio/directory/base.rb,
lib/zaikio/directory/role.rb,
lib/zaikio/directory/site.rb,
lib/zaikio/directory/asset.rb,
lib/zaikio/directory/person.rb,
lib/zaikio/directory/machine.rb,
lib/zaikio/directory/version.rb,
lib/zaikio/directory/software.rb,
lib/zaikio/directory/connection.rb,
lib/zaikio/directory/membership.rb,
lib/zaikio/directory/specialist.rb,
lib/zaikio/directory/json_parser.rb,
lib/zaikio/directory/organization.rb,
lib/zaikio/directory/subscription.rb,
lib/zaikio/directory/test_account.rb,
lib/zaikio/directory/configuration.rb,
lib/zaikio/directory/current_person.rb,
lib/zaikio/directory/current_organization.rb,
lib/zaikio/directory/revoked_access_token.rb,
lib/zaikio/directory/basic_auth_middleware.rb,
lib/zaikio/directory/business_relationship.rb,
lib/zaikio/directory/organization_membership.rb,
lib/zaikio/directory/authorization_middleware.rb
Defined Under Namespace
Modules: Asset
Classes: AuthorizationMiddleware, Base, BasicAuthMiddleware, BusinessRelationship, Configuration, Connection, CurrentOrganization, CurrentPerson, JSONParser, Machine, Membership, Organization, OrganizationMembership, Person, RevokedAccessToken, Role, Site, Software, Specialist, Subscription, TestAccount
Constant Summary
collapse
- VERSION =
"0.2.0".freeze
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
32
33
34
|
# File 'lib/zaikio/directory.rb', line 32
def configuration
@configuration
end
|
Class Method Details
36
37
38
39
40
41
42
|
# File 'lib/zaikio/directory.rb', line 36
def configure
self.connection = nil
self.configuration ||= Configuration.new
yield(configuration)
Base.connection = create_connection
end
|
.create_connection ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/zaikio/directory.rb', line 66
def create_connection
self.connection = Faraday.new(url: "#{configuration.host}/api/v1",
ssl: { verify: configuration.environment != :test }) do |c|
c.request :json
c.response :logger, configuration&.logger
c.use JSONParser
c.use AuthorizationMiddleware
c.use BasicAuthMiddleware
c.adapter Faraday.default_adapter
end
end
|
.current_token_data ⇒ Object
.with_basic_auth(login, password) ⇒ Object
.with_token(token) ⇒ Object