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