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.
23
24
25
26
|
# File 'lib/jets/resource.rb', line 23
def initialize(definition, replacements={})
@definition = definition
@replacements = replacements
end
|
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
22
23
24
|
# File 'lib/jets/resource.rb', line 22
def definition
@definition
end
|
#replacements ⇒ Object
Returns the value of attribute replacements.
22
23
24
|
# File 'lib/jets/resource.rb', line 22
def replacements
@replacements
end
|
Instance Method Details
#attributes ⇒ Object
53
54
55
56
57
|
# File 'lib/jets/resource.rb', line 53
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
Jets::Camelizer.transform(attributes)
end
|
#logical_id ⇒ Object
38
39
40
41
42
43
|
# File 'lib/jets/resource.rb', line 38
def logical_id
id = template.keys.first
id = replacer.replace_value(id)
Jets::Camelizer.camelize(id)
end
|
#outputs ⇒ Object
63
64
65
|
# File 'lib/jets/resource.rb', line 63
def outputs
{}
end
|
#parameters ⇒ Object
59
60
61
|
# File 'lib/jets/resource.rb', line 59
def parameters
{}
end
|
#permission ⇒ Object
72
73
74
|
# File 'lib/jets/resource.rb', line 72
def permission
Permission.new(replacements, self)
end
|
#properties ⇒ Object
49
50
51
|
# File 'lib/jets/resource.rb', line 49
def properties
attributes['Properties']
end
|
#replacer ⇒ Object
67
68
69
|
# File 'lib/jets/resource.rb', line 67
def replacer
Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
34
35
36
|
# File 'lib/jets/resource.rb', line 34
def standarize(*definition)
Standardizer.new(definition).template
end
|
#template ⇒ Object
28
29
30
|
# File 'lib/jets/resource.rb', line 28
def template
standarize(definition)
end
|
#type ⇒ Object
45
46
47
|
# File 'lib/jets/resource.rb', line 45
def type
attributes['Type']
end
|