Class: Jets::Resource
- Inherits:
-
Object
show all
- Extended by:
- Memoist
- Defined in:
- lib/jets/resource/base.rb,
lib/jets/resource.rb,
lib/jets/resource/replacer.rb,
lib/jets/resource/associated.rb,
lib/jets/resource/permission.rb,
lib/jets/resource/standardizer.rb
Overview
Does not do full expansion, mainly a container that holds the definition and standardizes it without camelizing it.
Defined Under Namespace
Modules: ApiGateway, ChildStack, Config, Events, Iam, Iot, Lambda, Logs, Route53, S3, Sns, Sqs
Classes: Associated, Base, Permission, Replacer, Standardizer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(definition, replacements = {}) ⇒ Resource
Returns a new instance of Resource.
5
6
7
8
|
# File 'lib/jets/resource.rb', line 5
def initialize(definition, replacements={})
@definition = definition
@replacements = replacements
end
|
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
4
5
6
|
# File 'lib/jets/resource.rb', line 4
def definition
@definition
end
|
#replacements ⇒ Object
Returns the value of attribute replacements.
4
5
6
|
# File 'lib/jets/resource.rb', line 4
def replacements
@replacements
end
|
Instance Method Details
#attributes ⇒ Object
35
36
37
38
39
|
# File 'lib/jets/resource.rb', line 35
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
Jets::Camelizer.transform(attributes)
end
|
#logical_id ⇒ Object
20
21
22
23
24
25
|
# File 'lib/jets/resource.rb', line 20
def logical_id
id = template.keys.first
id = replacer.replace_value(id)
Jets::Camelizer.camelize(id)
end
|
#outputs ⇒ Object
45
46
47
|
# File 'lib/jets/resource.rb', line 45
def outputs
{}
end
|
#parameters ⇒ Object
41
42
43
|
# File 'lib/jets/resource.rb', line 41
def parameters
{}
end
|
#permission ⇒ Object
54
55
56
|
# File 'lib/jets/resource.rb', line 54
def permission
Permission.new(replacements, self)
end
|
#properties ⇒ Object
31
32
33
|
# File 'lib/jets/resource.rb', line 31
def properties
attributes['Properties']
end
|
#replacer ⇒ Object
49
50
51
|
# File 'lib/jets/resource.rb', line 49
def replacer
Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
16
17
18
|
# File 'lib/jets/resource.rb', line 16
def standarize(*definition)
Standardizer.new(definition).template
end
|
#template ⇒ Object
10
11
12
|
# File 'lib/jets/resource.rb', line 10
def template
standarize(definition)
end
|
#type ⇒ Object
27
28
29
|
# File 'lib/jets/resource.rb', line 27
def type
attributes['Type']
end
|