Class: Momo::MemberReference

Inherits:
FuncCall show all
Defined in:
lib/momo/memberreference.rb

Instance Method Summary collapse

Methods inherited from FuncCall

#representation

Constructor Details

#initialize(resource_name, member_name, stack) ⇒ MemberReference

Returns a new instance of MemberReference.



4
5
6
7
8
# File 'lib/momo/memberreference.rb', line 4

def initialize(resource_name, member_name, stack)
	@resource = resource_name
	@member = member_name
	super("Fn::GetAtt", stack, "#{resource_name}", "#{member_name}")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



14
15
16
# File 'lib/momo/memberreference.rb', line 14

def method_missing(name, *args, &block)
	MemberReference.new(@resource, "#{@member}.#{name}", @stack)
end

Instance Method Details

#[](index) ⇒ Object



18
19
20
# File 'lib/momo/memberreference.rb', line 18

def [](index)
	FuncCall.new("Fn::Select", @stack, index, self)
end

#memberObject



10
11
12
# File 'lib/momo/memberreference.rb', line 10

def member
	@member
end