humidifier 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f100bf8d62287928a8d32c3acdc6b719fff03af0
4
- data.tar.gz: 57cafed259b64cdf0d280aca090e2c1ef09bc101
3
+ metadata.gz: 49e71afc90f25c69c4186ef0d296bb6a4709c8c4
4
+ data.tar.gz: 249d24a729f0d5c92dee6987eefc974c6ff947c6
5
5
  SHA512:
6
- metadata.gz: a1706b2549e7dc2028dd0e64b99640fefa468b2137751fd16482148651d74ec8276bf75a364624da8e0b867f4e42b5793ab8d8078a56dd11e5636632b70f81b7
7
- data.tar.gz: ac5a412abcf4cf69dfd167c0277ba9333c7a908f8d3bf7014e007fcb98ec4ac79dcb9ec7aa0ec7eb8d5a810a2e3988fa6adcc57036c9bdb99bb35705918382a7
6
+ metadata.gz: b483ce9400693c726c93a8a50aa703fc446d2dc20d7efa8c7dd03a3ad1e10f13ccc1a030679103ef0c05fd701b423a7d592b1d37dec0d0f18f41e4c1cc52160b
7
+ data.tar.gz: 244bf6664b9b54a2ecf69d72a19df94d10c65e464fc0912f12773d7729e9417816eabe25b6b38bbcb53274c093a66088eb1adaaeed927f70b36ff5ef53dcb274
@@ -44,6 +44,14 @@ module Humidifier
44
44
  properties.each { |property, value| update_property(property, value, raw) }
45
45
  end
46
46
 
47
+ # Update the attributes of the resource defined by COMMON_ATTRIBUTES
48
+ def update_attributes(attributes)
49
+ attributes.each do |attribute, value|
50
+ raise ArgumentError, "Invalid attribute: #{attribute}" unless COMMON_ATTRIBUTES.value?(attribute)
51
+ public_send(:"#{attribute}=", value)
52
+ end
53
+ end
54
+
47
55
  # Update an individual property on this resource
48
56
  def update_property(property, value, raw = false)
49
57
  property = property.to_s
@@ -19,9 +19,11 @@ module Humidifier
19
19
  STATIC_RESOURCES.values.each { |prop| send(:"#{prop}=", opts[prop]) }
20
20
  end
21
21
 
22
- # Add a resource to the stack
23
- def add(name, resource)
22
+ # Add a resource to the stack and optionally set its attributes
23
+ def add(name, resource, attributes = {})
24
24
  resources[name] = resource
25
+ resource.update_attributes(attributes) if attributes.any?
26
+ resource
25
27
  end
26
28
 
27
29
  # The identifier used by the shim to find the stack in CFN, prefers id to name
@@ -1,4 +1,4 @@
1
1
  module Humidifier
2
2
  # Gem version
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humidifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Localytics
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler