Sha256: aca3e10bc0827170ead831d179472dcae7160504fd9b456d7908e8e08a3800e2
Contents?: true
Size: 1.03 KB
Versions: 3
Compression:
Stored size: 1.03 KB
Contents
require File.expand_path("heracles-wrapper/version", File.dirname(__FILE__)) require File.expand_path("heracles-wrapper/config", File.dirname(__FILE__)) require File.expand_path("heracles-wrapper/exceptions", File.dirname(__FILE__)) require File.expand_path("heracles-wrapper/request/create_job", File.dirname(__FILE__)) require 'morphine' module Heracles module Wrapper module_function def configure(&block) @config = Config.new(&block) end def config if @config.nil? raise ConfigurationError.new("#{self}.config not set") end if @config.api_key.nil? raise ConfigurationError.new("#{self}.config.api_key is invalid") end @config end def clear_config! @config = nil end def service(service_name, options = {}) send("#{service_name}_service").call(config,options) end class << self include Morphine private register :create_job_service do Heracles::Wrapper::Request::CreateJob.method(:new) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
heracles-wrapper-0.0.3 | lib/heracles-wrapper.rb |
heracles-wrapper-0.0.2 | lib/heracles-wrapper.rb |
heracles-wrapper-0.0.1 | lib/heracles-wrapper.rb |