Sha256: 0936eda05a6016aa1fc5aae8d186c196d7e6a859fb1270ee6bc641af2fbf7a64

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

# [UNDER DEVELOPMENT] awsrm [![Gem](https://img.shields.io/gem/v/awsrm.svg)](https://rubygems.org/gems/awsrm) [![Travis](https://img.shields.io/travis/k1LoW/awsrm.svg)](https://travis-ci.org/k1LoW/awsrm) 

Simple AWS Resource "READONLY" Mapper for awspec.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'awsrm'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install awsrm

## Usage

### ::one

`Awsrm::Resource::one` identify uniquely one resource or raise error. this method not like ActiveRecord `find` .

- identify `1` resource -> return resource
- identify `0` resource -> raise error
- identify `>1` resources -> raise error

```ruby
require 'awspec'
require 'awsrm'

describe route_table(Awsrm::RouteTable.one(name: 'my-route-table', vpc: 'my-vpc').id) do
  it { should exist }
  it { should belong_to_vpc('my-vpc') }
end
```

### ::all

`Awsrm::Resource::all` return all resources.

- identify `0` resource -> return empty array
- identify `>1` resources -> return resources array

```ruby
require 'awspec'
require 'awsrm'

Awsrm::RouteTable.all(vpc: 'my-vpc').each do | route |
  describe route_table(route.id) do
    it { should exist }
    it { should belong_to_vpc('my-vpc') }
  end
end
```

## 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
awsrm-0.0.1 README.md