Module: Puppet::Pops::Model::LiteralRegularExpression::ClassModule
- Defined in:
- lib/puppet/pops/model/model.rb
Instance Method Summary collapse
- #pattern=(regexp_string) ⇒ Object
-
#value=(regexp) ⇒ Object
Go through the gymnastics of making either value or pattern settable with synchronization to the other form.
Instance Method Details
#pattern=(regexp_string) ⇒ Object
82 83 84 85 |
# File 'lib/puppet/pops/model/model.rb', line 82 def pattern= regexp_string setPattern regexp_string setValue Regexp.new(regexp_string) end |
#value=(regexp) ⇒ Object
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.
77 78 79 80 |
# File 'lib/puppet/pops/model/model.rb', line 77 def value= regexp setValue regexp setPattern regexp.to_s end |