Sha256: 8c366dc134031097eb3a9dcde717cffe720b10f1a192a1f4d0eff23c7e72b086

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

require "cavalry/version"
require "active_support"
require "active_model"

module Cavalry
  autoload :Config, 'cavalry/config'
  autoload :Client, 'cavalry/client'
  autoload :Validator, 'cavalry/validator'
  autoload :Error, 'cavalry/error'

  class DSLError < RuntimeError; end

  class << self
    def configure
      yield config
    end

    delegate :run, :errors, :dump, to: :client

    def valid?
      run unless client.done?
      errors.blank?
    end


    private

    def client
      @client ||= Client.new(config)
    end

    def config
      @config ||= Config.new
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cavalry-0.1.0 lib/cavalry.rb