class Puppet::Pops::Model::LiteralList

Attributes

values[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
936 def self._pcore_type
937   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralList', {
938     'parent' => Expression._pcore_type,
939     'attributes' => {
940       'values' => {
941         'type' => Types::PArrayType.new(Expression._pcore_type),
942         'value' => []
943       }
944     }
945   })
946 end
create(locator, offset, length, values = _pcore_type['values'].value) click to toggle source
    # File lib/puppet/pops/model/ast.rb
960 def self.create(locator, offset, length, values = _pcore_type['values'].value)
961   ta = Types::TypeAsserter
962   attrs = _pcore_type.attributes(true)
963   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
964   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
965   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
966   ta.assert_instance_of('Puppet::AST::LiteralList[values]', attrs['values'].type, values)
967   new(locator, offset, length, values)
968 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
952 def self.from_asserted_hash(init_hash)
953   new(
954     init_hash['locator'],
955     init_hash['offset'],
956     init_hash['length'],
957     init_hash.fetch('values') { _pcore_type['values'].value })
958 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
948 def self.from_hash(init_hash)
949   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralList initializer', _pcore_type.init_hash_type, init_hash))
950 end
new(locator, offset, length, values = _pcore_type['values'].value) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
    # File lib/puppet/pops/model/ast.rb
972 def initialize(locator, offset, length, values = _pcore_type['values'].value)
973   super(locator, offset, length)
974   @hash = @hash ^ values.hash
975   @values = values
976 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
988 def _pcore_all_contents(path, &block)
989   path << self
990   @values.each do |value|
991     block.call(value, path)
992     value._pcore_all_contents(path, &block)
993   end
994   path.pop
995 end
_pcore_contents() { |value| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
984 def _pcore_contents
985   @values.each { |value| yield(value) }
986 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
978 def _pcore_init_hash
979   result = super
980   result['values'] = @values unless _pcore_type['values'].default_value?(@values)
981   result
982 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
 997 def eql?(o)
 998   super &&
 999   @values.eql?(o.values)
1000 end
Also aliased as: ==