class Puppet::Pops::Model::HeredocExpression

Attributes

syntax[R]
text_expr[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2445 def self._pcore_type
2446   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::HeredocExpression', {
2447     'parent' => Expression._pcore_type,
2448     'attributes' => {
2449       'syntax' => {
2450         'type' => Types::POptionalType.new(Types::PStringType::DEFAULT),
2451         'value' => nil
2452       },
2453       'text_expr' => Expression._pcore_type
2454     }
2455   })
2456 end
create(locator, offset, length, text_expr, syntax = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2471 def self.create(locator, offset, length, text_expr, syntax = nil)
2472   ta = Types::TypeAsserter
2473   attrs = _pcore_type.attributes(true)
2474   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2475   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2476   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2477   ta.assert_instance_of('Puppet::AST::HeredocExpression[syntax]', attrs['syntax'].type, syntax)
2478   ta.assert_instance_of('Puppet::AST::HeredocExpression[text_expr]', attrs['text_expr'].type, text_expr)
2479   new(locator, offset, length, text_expr, syntax)
2480 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2462 def self.from_asserted_hash(init_hash)
2463   new(
2464     init_hash['locator'],
2465     init_hash['offset'],
2466     init_hash['length'],
2467     init_hash['text_expr'],
2468     init_hash['syntax'])
2469 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2458 def self.from_hash(init_hash)
2459   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::HeredocExpression initializer', _pcore_type.init_hash_type, init_hash))
2460 end
new(locator, offset, length, text_expr, syntax = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
2485 def initialize(locator, offset, length, text_expr, syntax = nil)
2486   super(locator, offset, length)
2487   @hash = @hash ^ syntax.hash ^ text_expr.hash
2488   @syntax = syntax
2489   @text_expr = text_expr
2490 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2503 def _pcore_all_contents(path, &block)
2504   path << self
2505   unless @text_expr.nil?
2506     block.call(@text_expr, path)
2507     @text_expr._pcore_all_contents(path, &block)
2508   end
2509   path.pop
2510 end
_pcore_contents() { |text_expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
2499 def _pcore_contents
2500   yield(@text_expr) unless @text_expr.nil?
2501 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
2492 def _pcore_init_hash
2493   result = super
2494   result['syntax'] = @syntax unless @syntax == nil
2495   result['text_expr'] = @text_expr
2496   result
2497 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
2512 def eql?(o)
2513   super &&
2514   @syntax.eql?(o.syntax) &&
2515   @text_expr.eql?(o.text_expr)
2516 end
Also aliased as: ==