Class: Staypuft::Deployment::AbstractParamScope

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Callbacks, AttributeParamStorage
Includes:
ActiveModel::Validations
Defined in:
app/models/staypuft/deployment/abstract_param_scope.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AttributeParamStorage

param_attr, param_attr_array, param_scope

Constructor Details

#initialize(deployment) ⇒ AbstractParamScope

Returns a new instance of AbstractParamScope.



14
15
16
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 14

def initialize(deployment)
  @deployment = deployment
end

Instance Attribute Details

#deploymentObject (readonly)

Returns the value of attribute deployment.



12
13
14
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 12

def deployment
  @deployment
end

Class Method Details

.param_scopeObject

Raises:

  • (NotImplementedError)


8
9
10
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 8

def self.param_scope
  raise NotImplementedError
end

Instance Method Details

#attributes=(attr_list) ⇒ Object



27
28
29
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 27

def attributes=(attr_list)
  attr_list.each { |attr, value| send "#{attr}=", value } unless attr_list.nil?
end

#hostgroupObject



18
19
20
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 18

def hostgroup
  deployment.hostgroup
end

#marked_for_destruction?Boolean

compatibility with validates_associated

Returns:

  • (Boolean)


23
24
25
# File 'app/models/staypuft/deployment/abstract_param_scope.rb', line 23

def marked_for_destruction?
  false
end