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/function.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, Route53, Sns
Classes: Associated, Base, Function, Permission, Replacer, S3, Standardizer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(definition, replacements = {}) ⇒ Resource
Returns a new instance of Resource.
20
21
22
23
|
# File 'lib/jets/resource.rb', line 20
def initialize(definition, replacements={})
@definition = definition
@replacements = replacements
end
|
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
19
20
21
|
# File 'lib/jets/resource.rb', line 19
def definition
@definition
end
|
#replacements ⇒ Object
Returns the value of attribute replacements.
19
20
21
|
# File 'lib/jets/resource.rb', line 19
def replacements
@replacements
end
|
Instance Method Details
#attributes ⇒ Object
50
51
52
53
54
|
# File 'lib/jets/resource.rb', line 50
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
Jets::Camelizer.transform(attributes)
end
|
#logical_id ⇒ Object
35
36
37
38
39
40
|
# File 'lib/jets/resource.rb', line 35
def logical_id
id = template.keys.first
id = replacer.replace_value(id)
Jets::Camelizer.camelize(id)
end
|
#outputs ⇒ Object
60
61
62
|
# File 'lib/jets/resource.rb', line 60
def outputs
{}
end
|
#parameters ⇒ Object
56
57
58
|
# File 'lib/jets/resource.rb', line 56
def parameters
{}
end
|
#permission ⇒ Object
69
70
71
|
# File 'lib/jets/resource.rb', line 69
def permission
Permission.new(replacements, self)
end
|
#properties ⇒ Object
46
47
48
|
# File 'lib/jets/resource.rb', line 46
def properties
attributes['Properties']
end
|
#replacer ⇒ Object
64
65
66
|
# File 'lib/jets/resource.rb', line 64
def replacer
Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
31
32
33
|
# File 'lib/jets/resource.rb', line 31
def standarize(*definition)
Standardizer.new(definition).template
end
|
#template ⇒ Object
25
26
27
|
# File 'lib/jets/resource.rb', line 25
def template
standarize(definition)
end
|
#type ⇒ Object
42
43
44
|
# File 'lib/jets/resource.rb', line 42
def type
attributes['Type']
end
|