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
3157 def self._pcore_type
3158   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralRegularExpression', {
3159     'parent' => LiteralValue._pcore_type,
3160     'attributes' => {
3161       'value' => Types::PAnyType::DEFAULT,
3162       'pattern' => Types::PStringType::DEFAULT
3163     }
3164   })
3165 end
create(locator, offset, length, value, pattern) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3180 def self.create(locator, offset, length, value, pattern)
3181   ta = Types::TypeAsserter
3182   attrs = _pcore_type.attributes(true)
3183   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3184   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3185   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3186   ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[value]', attrs['value'].type, value)
3187   ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[pattern]', attrs['pattern'].type, pattern)
3188   new(locator, offset, length, value, pattern)
3189 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3171 def self.from_asserted_hash(init_hash)
3172   new(
3173     init_hash['locator'],
3174     init_hash['offset'],
3175     init_hash['length'],
3176     init_hash['value'],
3177     init_hash['pattern'])
3178 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3167 def self.from_hash(init_hash)
3168   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralRegularExpression initializer', _pcore_type.init_hash_type, init_hash))
3169 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
3194 def initialize(locator, offset, length, value, pattern)
3195   super(locator, offset, length)
3196   @hash = @hash ^ value.hash ^ pattern.hash
3197   @value = value
3198   @pattern = pattern
3199 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
3201 def _pcore_init_hash
3202   result = super
3203   result['value'] = @value
3204   result['pattern'] = @pattern
3205   result
3206 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3208 def eql?(o)
3209   super &&
3210   @value.eql?(o.value) &&
3211   @pattern.eql?(o.pattern)
3212 end
Also aliased as: ==