Class: Terraform::StatesFinder
- Inherits:
-
Object
- Object
- Terraform::StatesFinder
- Defined in:
- app/finders/terraform/states_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, current_user, params: {}) ⇒ StatesFinder
constructor
A new instance of StatesFinder.
Constructor Details
#initialize(project, current_user, params: {}) ⇒ StatesFinder
Returns a new instance of StatesFinder.
5 6 7 8 9 |
# File 'app/finders/terraform/states_finder.rb', line 5 def initialize(project, current_user, params: {}) @project = project @current_user = current_user @params = params end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/finders/terraform/states_finder.rb', line 11 def execute return ::Terraform::State.none unless can_read_terraform_states? states = project.terraform_states states = states.with_name(params[:name]) if params[:name].present? states.ordered_by_name end |