module Berkshelf::API::Mixin::Services::ClassMethods

Public Instance Methods

cache_builder() click to toggle source

@raise [Berkshelf::API::NotStartedError] if the cache manager has not been started

@return [Berkshelf::API::CacheBuilder]

# File lib/berkshelf/api/mixin/services.rb, line 19
def cache_builder
  app_actor(:cache_builder)
end
cache_manager() click to toggle source

@raise [Berkshelf::API::NotStartedError] if the cache manager has not been started

@return [Berkshelf::API::CacheManager]

# File lib/berkshelf/api/mixin/services.rb, line 26
def cache_manager
  app_actor(:cache_manager)
end
rest_gateway() click to toggle source

@raise [Berkshelf::API::NotStartedError] if the rest gateway has not been started

@return [Berkshelf::API::RESTGateway]

# File lib/berkshelf/api/mixin/services.rb, line 33
def rest_gateway
  app_actor(:rest_gateway)
end

Private Instance Methods

app_actor(id) click to toggle source
# File lib/berkshelf/api/mixin/services.rb, line 39
def app_actor(id)
  unless Application[id] && Application[id].alive?
    raise NotStartedError, "#{id} not running"
  end
  Application[id]
end