class Puppet::Pops::Model::ComparisonExpression

Attributes

operator[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
681 def self._pcore_type
682   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ComparisonExpression', {
683     'parent' => BinaryExpression._pcore_type,
684     'attributes' => {
685       'operator' => Types::PEnumType.new(['!=', '<', '<=', '==', '>', '>='])
686     }
687   })
688 end
create(locator, offset, length, left_expr, right_expr, operator) click to toggle source
    # File lib/puppet/pops/model/ast.rb
704 def self.create(locator, offset, length, left_expr, right_expr, operator)
705   ta = Types::TypeAsserter
706   attrs = _pcore_type.attributes(true)
707   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
708   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
709   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
710   ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
711   ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
712   ta.assert_instance_of('Puppet::AST::ComparisonExpression[operator]', attrs['operator'].type, operator)
713   new(locator, offset, length, left_expr, right_expr, operator)
714 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
694 def self.from_asserted_hash(init_hash)
695   new(
696     init_hash['locator'],
697     init_hash['offset'],
698     init_hash['length'],
699     init_hash['left_expr'],
700     init_hash['right_expr'],
701     init_hash['operator'])
702 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
690 def self.from_hash(init_hash)
691   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ComparisonExpression initializer', _pcore_type.init_hash_type, init_hash))
692 end
new(locator, offset, length, left_expr, right_expr, operator) click to toggle source
    # File lib/puppet/pops/model/ast.rb
718 def initialize(locator, offset, length, left_expr, right_expr, operator)
719   super(locator, offset, length, left_expr, right_expr)
720   @hash = @hash ^ operator.hash
721   @operator = operator
722 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
735 def _pcore_all_contents(path, &block)
736   path << self
737   unless @left_expr.nil?
738     block.call(@left_expr, path)
739     @left_expr._pcore_all_contents(path, &block)
740   end
741   unless @right_expr.nil?
742     block.call(@right_expr, path)
743     @right_expr._pcore_all_contents(path, &block)
744   end
745   path.pop
746 end
_pcore_contents() { |left_expr| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
730 def _pcore_contents
731   yield(@left_expr) unless @left_expr.nil?
732   yield(@right_expr) unless @right_expr.nil?
733 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
724 def _pcore_init_hash
725   result = super
726   result['operator'] = @operator
727   result
728 end
eql?(o) click to toggle source
    # File lib/puppet/pops/model/ast.rb
748 def eql?(o)
749   super &&
750   @operator.eql?(o.operator)
751 end
Also aliased as: ==