Class: Jets::Resource
- Inherits:
-
Object
show all
- Extended by:
- Memoist
- Defined in:
- lib/jets/resource/base.rb,
lib/jets/resource.rb,
lib/jets/resource/s3.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, Lambda, Route53, Sns, Sqs
Classes: Associated, Base, Permission, Replacer, S3, Standardizer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(definition, replacements = {}) ⇒ Resource
Returns a new instance of Resource.
21
22
23
24
|
# File 'lib/jets/resource.rb', line 21
def initialize(definition, replacements={})
@definition = definition
@replacements = replacements
end
|
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
20
21
22
|
# File 'lib/jets/resource.rb', line 20
def definition
@definition
end
|
#replacements ⇒ Object
Returns the value of attribute replacements.
20
21
22
|
# File 'lib/jets/resource.rb', line 20
def replacements
@replacements
end
|
Instance Method Details
#attributes ⇒ Object
51
52
53
54
55
|
# File 'lib/jets/resource.rb', line 51
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
Jets::Camelizer.transform(attributes)
end
|
#logical_id ⇒ Object
36
37
38
39
40
41
|
# File 'lib/jets/resource.rb', line 36
def logical_id
id = template.keys.first
id = replacer.replace_value(id)
Jets::Camelizer.camelize(id)
end
|
#outputs ⇒ Object
61
62
63
|
# File 'lib/jets/resource.rb', line 61
def outputs
{}
end
|
#parameters ⇒ Object
57
58
59
|
# File 'lib/jets/resource.rb', line 57
def parameters
{}
end
|
#permission ⇒ Object
70
71
72
|
# File 'lib/jets/resource.rb', line 70
def permission
Permission.new(replacements, self)
end
|
#properties ⇒ Object
47
48
49
|
# File 'lib/jets/resource.rb', line 47
def properties
attributes['Properties']
end
|
#replacer ⇒ Object
65
66
67
|
# File 'lib/jets/resource.rb', line 65
def replacer
Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
32
33
34
|
# File 'lib/jets/resource.rb', line 32
def standarize(*definition)
Standardizer.new(definition).template
end
|
#template ⇒ Object
26
27
28
|
# File 'lib/jets/resource.rb', line 26
def template
standarize(definition)
end
|
#type ⇒ Object
43
44
45
|
# File 'lib/jets/resource.rb', line 43
def type
attributes['Type']
end
|