module Puppet::Pops::PN

Constants

KEY_PATTERN

Public Instance Methods

==(o) click to toggle source
   # File lib/puppet/pops/pn.rb
17 def ==(o)
18   eql?(o)
19 end
as_call(name) click to toggle source
   # File lib/puppet/pops/pn.rb
 9 def as_call(name)
10   Call.new(name, self)
11 end
as_parameters() click to toggle source
   # File lib/puppet/pops/pn.rb
13 def as_parameters
14   [self]
15 end
double_quote(str, bld) click to toggle source
   # File lib/puppet/pops/pn.rb
31 def double_quote(str, bld)
32   bld << '"'
33   str.each_codepoint do |codepoint|
34     case codepoint
35     when 0x09
36       bld << '\\t'
37     when 0x0a
38       bld << '\\n'
39     when 0x0d
40       bld << '\\r'
41     when 0x22
42       bld << '\\"'
43     when 0x5c
44       bld << '\\\\'
45     else
46       if codepoint < 0x20
47         bld << sprintf('\\o%3.3o', codepoint)
48       elsif codepoint <= 0x7f
49         bld << codepoint
50       else
51         bld << [codepoint].pack('U')
52       end
53     end
54   end
55   bld << '"'
56 end
format_elements(elements, indent, b) click to toggle source
   # File lib/puppet/pops/pn.rb
58 def format_elements(elements, indent, b)
59   elements.each_with_index do |e, i|
60     if indent
61       b << "\n" << indent.current
62     elsif i > 0
63       b << ' '
64     end
65     e.format(indent, b)
66   end
67 end
pnError(message) click to toggle source
  # File lib/puppet/pops/pn.rb
5 def pnError(message)
6   raise ArgumentError, message
7 end
to_s() click to toggle source
   # File lib/puppet/pops/pn.rb
21 def to_s
22   s = ''
23   format(nil, s)
24   s
25 end
with_name(name) click to toggle source
   # File lib/puppet/pops/pn.rb
27 def with_name(name)
28   Entry.new(name, self)
29 end