Module: Jenkins::Model::Transience

Included in:
ClassMethods
Defined in:
lib/jenkins/model.rb

Instance Method Summary collapse

Instance Method Details

#transient(*properties) ⇒ Object

Mark a set of properties that should not be persisted as part of this Model’s lifecycle.

Jenkins supports transparent persistent



33
34
35
36
37
# File 'lib/jenkins/model.rb', line 33

def transient(*properties)
  properties.each do |p|
    transients[p.to_sym] = true
  end
end

#transient?(property) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/jenkins/model.rb', line 39

def transient?(property)
  transients.keys.member?(property.to_sym) || (superclass < Model && superclass.transient?(property))
end

#transientsObject



43
44
45
# File 'lib/jenkins/model.rb', line 43

def transients
  @transients ||= {}
end