Module: Puppet::Pops::Model::LiteralRegularExpression::ClassModule Private

Defined in:
lib/puppet/pops/model/model.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#pattern=(regexp_string) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



91
92
93
94
# File 'lib/puppet/pops/model/model.rb', line 91

def pattern= regexp_string
  setPattern regexp_string
  setValue Regexp.new(regexp_string)
end

#value=(regexp) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Go through the gymnastics of making either value or pattern settable with synchronization to the other form. A derived value cannot be serialized and we want to serialize the pattern. When recreating the object we need to recreate it from the pattern string. The below sets both values if one is changed.



86
87
88
89
# File 'lib/puppet/pops/model/model.rb', line 86

def value= regexp
  setValue regexp
  setPattern regexp.to_s
end