class Puppet::Pops::Model::LiteralRegularExpression

Attributes

pattern[R]
value[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3156 def self._pcore_type
3157   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralRegularExpression', {
3158     'parent' => LiteralValue._pcore_type,
3159     'attributes' => {
3160       'value' => Types::PAnyType::DEFAULT,
3161       'pattern' => Types::PStringType::DEFAULT
3162     }
3163   })
3164 end
create(locator, offset, length, value, pattern) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3179 def self.create(locator, offset, length, value, pattern)
3180   ta = Types::TypeAsserter
3181   attrs = _pcore_type.attributes(true)
3182   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3183   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3184   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3185   ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[value]', attrs['value'].type, value)
3186   ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[pattern]', attrs['pattern'].type, pattern)
3187   new(locator, offset, length, value, pattern)
3188 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3170 def self.from_asserted_hash(init_hash)
3171   new(
3172     init_hash['locator'],
3173     init_hash['offset'],
3174     init_hash['length'],
3175     init_hash['value'],
3176     init_hash['pattern'])
3177 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3166 def self.from_hash(init_hash)
3167   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralRegularExpression initializer', _pcore_type.init_hash_type, init_hash))
3168 end
new(locator, offset, length, value, pattern) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
3193 def initialize(locator, offset, length, value, pattern)
3194   super(locator, offset, length)
3195   @hash = @hash ^ value.hash ^ pattern.hash
3196   @value = value
3197   @pattern = pattern
3198 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
3200 def _pcore_init_hash
3201   result = super
3202   result['value'] = @value
3203   result['pattern'] = @pattern
3204   result
3205 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3207 def eql?(o)
3208   super &&
3209   @value.eql?(o.value) &&
3210   @pattern.eql?(o.pattern)
3211 end
Also aliased as: ==