Sha256: d634942f5717a3bc2fd980201fff193039e1d412542a51f801d29571988270a8

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

# SoarConfiguredFactory

This gem provides the basic factory for the SOAR architecture.  The factory creates objects based on adaptors specified in the configuration.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'soar_configured_factory'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install soar_configured_factory

## Testing

Run the rspec test tests:

    $ bundle exec rspec -cfd spec

## Usage

Create the factory by instantiating it with the configuration containing the adaptor classes:

```ruby
configuration = {
  'type_a' => {
    'adaptor' => 'type_a_class::type_a',
    'some other configuration' => 'the object of class type_a will need'
  }
}
my_factory = SoarConfiguredFactory::ConfiguredFactory.new(configuration)
```

Create objects using the factory by simply calling create:
```ruby
my_object = my_factory.create('type_a')
```

## Detailed example

```ruby
configuration = {
  'log4r' => {
    'adaptor' => 'Log4rAuditor::Log4rAuditor',
    'file_name' => 'soar_sc.log',
    'standard_stream' => 'stdout',
  }
}
auditor_factory = SoarConfiguredFactory::ConfiguredFactory.new(configuration)
auditor = auditor_factory.create('log4r')
```

## Contributing

Bug reports and feature requests are welcome by email to barney dot de dot villiers at hetzner dot co dot za. This gem is sponsored by Hetzner (Pty) Ltd (http://hetzner.co.za)

## Notes


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soar_configured_factory-0.1.1 README.md