class Puppet::Pops::Model::BinaryExpression

Attributes

left_expr[R]
right_expr[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
148 def self._pcore_type
149   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::BinaryExpression', {
150     'parent' => Expression._pcore_type,
151     'attributes' => {
152       'left_expr' => Expression._pcore_type,
153       'right_expr' => Expression._pcore_type
154     }
155   })
156 end
create(locator, offset, length, left_expr, right_expr) click to toggle source
    # File lib/puppet/pops/model/ast.rb
171 def self.create(locator, offset, length, left_expr, right_expr)
172   ta = Types::TypeAsserter
173   attrs = _pcore_type.attributes(true)
174   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
175   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
176   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
177   ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
178   ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
179   new(locator, offset, length, left_expr, right_expr)
180 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
162 def self.from_asserted_hash(init_hash)
163   new(
164     init_hash['locator'],
165     init_hash['offset'],
166     init_hash['length'],
167     init_hash['left_expr'],
168     init_hash['right_expr'])
169 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
158 def self.from_hash(init_hash)
159   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::BinaryExpression initializer', _pcore_type.init_hash_type, init_hash))
160 end
new(locator, offset, length, left_expr, right_expr) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
    # File lib/puppet/pops/model/ast.rb
185 def initialize(locator, offset, length, left_expr, right_expr)
186   super(locator, offset, length)
187   @hash = @hash ^ left_expr.hash ^ right_expr.hash
188   @left_expr = left_expr
189   @right_expr = right_expr
190 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
204 def _pcore_all_contents(path, &block)
205   path << self
206   unless @left_expr.nil?
207     block.call(@left_expr, path)
208     @left_expr._pcore_all_contents(path, &block)
209   end
210   unless @right_expr.nil?
211     block.call(@right_expr, path)
212     @right_expr._pcore_all_contents(path, &block)
213   end
214   path.pop
215 end
_pcore_contents() { |left_expr| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
199 def _pcore_contents
200   yield(@left_expr) unless @left_expr.nil?
201   yield(@right_expr) unless @right_expr.nil?
202 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
    # File lib/puppet/pops/model/ast.rb
192 def _pcore_init_hash
193   result = super
194   result['left_expr'] = @left_expr
195   result['right_expr'] = @right_expr
196   result
197 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
    # File lib/puppet/pops/model/ast.rb
217 def eql?(o)
218   super &&
219   @left_expr.eql?(o.left_expr) &&
220   @right_expr.eql?(o.right_expr)
221 end
Also aliased as: ==