class Puppet::Pops::Model::MatchExpression

Attributes

operator[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
757 def self._pcore_type
758   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::MatchExpression', {
759     'parent' => BinaryExpression._pcore_type,
760     'attributes' => {
761       'operator' => Types::PEnumType.new(['!~', '=~'])
762     }
763   })
764 end
create(locator, offset, length, left_expr, right_expr, operator) click to toggle source
    # File lib/puppet/pops/model/ast.rb
780 def self.create(locator, offset, length, left_expr, right_expr, operator)
781   ta = Types::TypeAsserter
782   attrs = _pcore_type.attributes(true)
783   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
784   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
785   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
786   ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
787   ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
788   ta.assert_instance_of('Puppet::AST::MatchExpression[operator]', attrs['operator'].type, operator)
789   new(locator, offset, length, left_expr, right_expr, operator)
790 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
770 def self.from_asserted_hash(init_hash)
771   new(
772     init_hash['locator'],
773     init_hash['offset'],
774     init_hash['length'],
775     init_hash['left_expr'],
776     init_hash['right_expr'],
777     init_hash['operator'])
778 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
766 def self.from_hash(init_hash)
767   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::MatchExpression initializer', _pcore_type.init_hash_type, init_hash))
768 end
new(locator, offset, length, left_expr, right_expr, operator) click to toggle source
    # File lib/puppet/pops/model/ast.rb
794 def initialize(locator, offset, length, left_expr, right_expr, operator)
795   super(locator, offset, length, left_expr, right_expr)
796   @hash = @hash ^ operator.hash
797   @operator = operator
798 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
811 def _pcore_all_contents(path, &block)
812   path << self
813   unless @left_expr.nil?
814     block.call(@left_expr, path)
815     @left_expr._pcore_all_contents(path, &block)
816   end
817   unless @right_expr.nil?
818     block.call(@right_expr, path)
819     @right_expr._pcore_all_contents(path, &block)
820   end
821   path.pop
822 end
_pcore_contents() { |left_expr| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
806 def _pcore_contents
807   yield(@left_expr) unless @left_expr.nil?
808   yield(@right_expr) unless @right_expr.nil?
809 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::BinaryExpression#_pcore_init_hash
    # File lib/puppet/pops/model/ast.rb
800 def _pcore_init_hash
801   result = super
802   result['operator'] = @operator
803   result
804 end
eql?(o) click to toggle source
    # File lib/puppet/pops/model/ast.rb
824 def eql?(o)
825   super &&
826   @operator.eql?(o.operator)
827 end
Also aliased as: ==