class Puppet::Pops::Model::MatchExpression
Attributes
operator[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 756 def self._pcore_type 757 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::MatchExpression', { 758 'parent' => BinaryExpression._pcore_type, 759 'attributes' => { 760 'operator' => Types::PEnumType.new(['!~', '=~']) 761 } 762 }) 763 end
create(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
# File lib/puppet/pops/model/ast.rb 779 def self.create(locator, offset, length, left_expr, right_expr, operator) 780 ta = Types::TypeAsserter 781 attrs = _pcore_type.attributes(true) 782 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 783 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 784 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 785 ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr) 786 ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr) 787 ta.assert_instance_of('Puppet::AST::MatchExpression[operator]', attrs['operator'].type, operator) 788 new(locator, offset, length, left_expr, right_expr, operator) 789 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 769 def self.from_asserted_hash(init_hash) 770 new( 771 init_hash['locator'], 772 init_hash['offset'], 773 init_hash['length'], 774 init_hash['left_expr'], 775 init_hash['right_expr'], 776 init_hash['operator']) 777 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 765 def self.from_hash(init_hash) 766 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::MatchExpression initializer', _pcore_type.init_hash_type, init_hash)) 767 end
new(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression::new
# File lib/puppet/pops/model/ast.rb 793 def initialize(locator, offset, length, left_expr, right_expr, operator) 794 super(locator, offset, length, left_expr, right_expr) 795 @hash = @hash ^ operator.hash 796 @operator = operator 797 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 810 def _pcore_all_contents(path, &block) 811 path << self 812 unless @left_expr.nil? 813 block.call(@left_expr, path) 814 @left_expr._pcore_all_contents(path, &block) 815 end 816 unless @right_expr.nil? 817 block.call(@right_expr, path) 818 @right_expr._pcore_all_contents(path, &block) 819 end 820 path.pop 821 end
_pcore_contents() { |left_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 805 def _pcore_contents 806 yield(@left_expr) unless @left_expr.nil? 807 yield(@right_expr) unless @right_expr.nil? 808 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 799 def _pcore_init_hash 800 result = super 801 result['operator'] = @operator 802 result 803 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression#eql?
# File lib/puppet/pops/model/ast.rb 823 def eql?(o) 824 super && 825 @operator.eql?(o.operator) 826 end
Also aliased as: ==