Class: Jets::Resource::ApiGateway::RestApi::Routes::Change::Variable
- Defined in:
- lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb
Class Method Summary collapse
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #collision ⇒ Object
-
#deployed_routes ⇒ Object
Only consider deployed routes with variables.
-
#new_paths ⇒ Object
Only consider paths with variables.
Methods inherited from Base
#controller_action_from_api, #controller_action_from_string, #get_controller_action, #lambda_function_description, #method_uri, #new_routes, #recreate_path, #recreate_to, #rest_api_id, #to
Methods included from AwsServices
#apigateway, #cfn, #lambda, #logs, #s3, #s3_resource, #sns, #sqs, #sts
Methods included from AwsServices::StackStatus
#lookup, #stack_exists?, #stack_in_progress?
Class Method Details
.changed? ⇒ Boolean
4 5 6 |
# File 'lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb', line 4 def self.changed? new.changed? end |
Instance Method Details
#changed? ⇒ Boolean
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb', line 8 def changed? changed = false deployed_routes.each do |deployed_route| parent = collision.variable_parent(deployed_route.path) parent_variables = collision.parent_variables(parent, [deployed_route.path]) new_parent_variables = collision.parent_variables(parent, new_paths) changed = parent_variables.size > 0 && new_parent_variables.size > 0 && parent_variables != new_parent_variables break if changed end changed end |
#collision ⇒ Object
35 36 37 |
# File 'lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb', line 35 def collision @collision ||= Jets::Resource::ApiGateway::RestApi::Routes::Collision.new end |
#deployed_routes ⇒ Object
Only consider deployed routes with variables
28 29 30 31 32 33 |
# File 'lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb', line 28 def deployed_routes deployed_routes = super deployed_routes.select do |route| route.path.include?(':') end end |
#new_paths ⇒ Object
Only consider paths with variables
23 24 25 |
# File 'lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb', line 23 def new_paths new_routes.map(&:path).select {|p| p.include?(':')}.uniq end |