Class: Jets::Resource
- Inherits:
-
Object
show all
- Extended by:
- Memoist
- Defined in:
- lib/jets/resource.rb,
lib/jets/resource/s3.rb,
lib/jets/resource/base.rb,
lib/jets/resource/function.rb,
lib/jets/resource/replacer.rb,
lib/jets/resource/permission.rb
Defined Under Namespace
Modules: ApiGateway, ChildStack, Iam
Classes: Base, Function, Permission, Replacer, S3
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(definition, replacements = {}) ⇒ Resource
Returns a new instance of Resource.
14
15
16
17
|
# File 'lib/jets/resource.rb', line 14
def initialize(definition, replacements={})
@definition = definition
@replacements = replacements
end
|
Instance Attribute Details
#definition ⇒ Object
Returns the value of attribute definition.
13
14
15
|
# File 'lib/jets/resource.rb', line 13
def definition
@definition
end
|
#replacements ⇒ Object
Returns the value of attribute replacements.
13
14
15
|
# File 'lib/jets/resource.rb', line 13
def replacements
@replacements
end
|
Instance Method Details
#attributes ⇒ Object
34
35
36
37
38
|
# File 'lib/jets/resource.rb', line 34
def attributes
attributes = definition.values.first
attributes = replacer.replace_placeholders(attributes)
Jets::Camelizer.transform(attributes)
end
|
#logical_id ⇒ Object
19
20
21
22
23
24
|
# File 'lib/jets/resource.rb', line 19
def logical_id
id = definition.keys.first
id = replacer.replace_value(id)
Jets::Camelizer.camelize(id)
end
|
#outputs ⇒ Object
44
45
46
|
# File 'lib/jets/resource.rb', line 44
def outputs
{}
end
|
#parameters ⇒ Object
40
41
42
|
# File 'lib/jets/resource.rb', line 40
def parameters
{}
end
|
#permission ⇒ Object
53
54
55
|
# File 'lib/jets/resource.rb', line 53
def permission
Permission.new(replacements, self)
end
|
#properties ⇒ Object
30
31
32
|
# File 'lib/jets/resource.rb', line 30
def properties
attributes['Properties']
end
|
#replacer ⇒ Object
48
49
50
|
# File 'lib/jets/resource.rb', line 48
def replacer
Replacer.new(replacements)
end
|
#type ⇒ Object
26
27
28
|
# File 'lib/jets/resource.rb', line 26
def type
attributes['Type']
end
|