<commit_before>motion-objection
================

Wrapping the dependency injection library [Objection](https://github.com/atomicobject/objection) in RubyMotion.

[![Build Status](https://travis-ci.org/atomicobject/motion-objection.png)](https://travis-ci.org/atomicobject/motion-objection)
[![Gem Version](https://badge.fury.io/rb/motion-objection.png)](http://badge.fury.io/rb/motion-objection)
[![Code Climate](https://codeclimate.com/github/atomicobject/motion-objection.png)](https://codeclimate.com/github/atomicobject/motion-objection)

## Install
```bash
gem install motion-objection
```
## Basic Example

```ruby
class Car
  include Objection::Compose
  compose_with :engine, :brakes, factory: JSObjectFactory
end

class Engine
  include Objection::Compose
  singleton
  compose_with 'engine/crank_shaft', 'engine/rod'

  def shift(wat)
    puts "SHIFT!"
  end

  class CrankShaft
  end 

  class Rod
  end
end

class Brakes
  def brake!
  end
end
```

## Initializers

```ruby
class ViewController < NSObject
  include Objection::Compose
  initializer "initWithNibName:bundle:", "Home"

  attr_reader :name

  def initWithNibName(name, bundle: bundle)
    self.init
    self.tap do
      @name = name
    end
  end
end
```

## Default Injector

```ruby
Objection.default_injector = Objection.injector AppModule.new, SecondaryModule.new
```
<commit_msg>Temporarily disabling build status until cocoa pods can be straightened out on Travis CI<commit_after>motion-objection
================

Wrapping the dependency injection library [Objection](https://github.com/atomicobject/objection) in RubyMotion.

<!-- [![Build Status](https://travis-ci.org/atomicobject/motion-objection.png)](https://travis-ci.org/atomicobject/motion-objection) -->
[![Gem Version](https://badge.fury.io/rb/motion-objection.png)](http://badge.fury.io/rb/motion-objection)
[![Code Climate](https://codeclimate.com/github/atomicobject/motion-objection.png)](https://codeclimate.com/github/atomicobject/motion-objection)

## Install
```bash
gem install motion-objection
```
## Basic Example

```ruby
class Car
  include Objection::Compose
  compose_with :engine, :brakes, factory: JSObjectFactory
end

class Engine
  include Objection::Compose
  singleton
  compose_with 'engine/crank_shaft', 'engine/rod'

  def shift(wat)
    puts "SHIFT!"
  end

  class CrankShaft
  end 

  class Rod
  end
end

class Brakes
  def brake!
  end
end
```

## Initializers

```ruby
class ViewController < NSObject
  include Objection::Compose
  initializer "initWithNibName:bundle:", "Home"

  attr_reader :name

  def initWithNibName(name, bundle: bundle)
    self.init
    self.tap do
      @name = name
    end
  end
end
```

## Default Injector

```ruby
Objection.default_injector = Objection.injector AppModule.new, SecondaryModule.new
```

{'fraction_non_alphanumeric': 0.1371082621082621, 'fraction_numerical': 0.0, 'mean_word_length': 4.686234817813765, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2782665', 'n_tokens_mistral': 975, 'n_tokens_neox': 905, 'n_words': 193}