Class: ForemanDeployments::ResourceModels::CreateResource

Inherits:
ActiveModel::Model
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Dirty
Defined in:
app/models/foreman_deployments/resource_models/create_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#computed_hashObject

Returns the value of attribute computed_hash.



9
10
11
# File 'app/models/foreman_deployments/resource_models/create_resource.rb', line 9

def computed_hash
  @computed_hash
end

#definition_hashObject

Returns the value of attribute definition_hash.



9
10
11
# File 'app/models/foreman_deployments/resource_models/create_resource.rb', line 9

def definition_hash
  @definition_hash
end

#resource_typeObject

Returns the value of attribute resource_type.



9
10
11
# File 'app/models/foreman_deployments/resource_models/create_resource.rb', line 9

def resource_type
  @resource_type
end

Instance Method Details

#new_resourceObject



11
12
13
14
15
# File 'app/models/foreman_deployments/resource_models/create_resource.rb', line 11

def new_resource
  computed_hash ||= definition_hash

  resource_type.new computed_hash
end