momo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ module Momo
2
+
3
+ class MemberReference < FuncCall
4
+ def initialize(resource_name, member_name)
5
+ @resource = resource_name
6
+ @member = member_name
7
+ super("Fn::GetAtt", "#{resource_name}", "#{member_name}")
8
+ end
9
+
10
+ def member
11
+ @member
12
+ end
13
+
14
+ def method_missing(name, *args, &block)
15
+ MemberReference.new(@resource, "#{@member}.#{name}")
16
+ end
17
+ end
18
+
19
+ end
data/lib/momo/resource.rb CHANGED
@@ -23,7 +23,7 @@ module Momo
23
23
  if !@complete
24
24
  @props[name] = Momo.resolve(args[0], resource: name)
25
25
  else
26
- FuncCall.new "Fn::GetAtt", "#{@name}", "#{name}"
26
+ MemberReference.new @name, name
27
27
  end
28
28
  end
29
29
 
data/lib/momo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Momo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/momo.rb CHANGED
@@ -6,6 +6,7 @@ require 'JSON'
6
6
  require 'momo/cfl'
7
7
  require 'momo/reference'
8
8
  require 'momo/funccall'
9
+ require 'momo/memberreference'
9
10
  require 'momo/momoscope'
10
11
  require 'momo/parameter'
11
12
  require 'momo/resource'
data/momo.gemspec CHANGED
@@ -28,4 +28,3 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "rake"
29
29
  spec.add_development_dependency "rspec"
30
30
  end
31
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: momo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-08 00:00:00.000000000 Z
12
+ date: 2016-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -141,6 +141,7 @@ files:
141
141
  - lib/momo/cfl.rb
142
142
  - lib/momo/funccall.rb
143
143
  - lib/momo/mapping.rb
144
+ - lib/momo/memberreference.rb
144
145
  - lib/momo/momoscope.rb
145
146
  - lib/momo/parameter.rb
146
147
  - lib/momo/reference.rb