Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/ruby/2.7.0/rexml/ |
Upload File : |
# frozen_string_literal: false require_relative "child" module REXML ## # Represents an XML comment; that is, text between \<!-- ... --> class Comment < Child include Comparable START = "<!--" STOP = "-->" # The content text attr_accessor :string ## # Constructor. The first argument can be one of three types: # @param first If String, the contents of this comment are set to the # argument. If Comment, the argument is duplicated. If # Source, the argument is scanned for a comment. # @param second If the first argument is a Source, this argument # should be nil, not supplied, or a Parent to be set as the parent # of this object def initialize( first, second = nil ) super(second) if first.kind_of? String @string = first elsif first.kind_of? Comment @string = first.string end end def clone Comment.new self end # == DEPRECATED # See REXML::Formatters # # output:: # Where to write the string # indent:: # An integer. If -1, no indenting will be used; otherwise, the # indentation will be this number of spaces, and children will be # indented an additional amount. # transitive:: # Ignored by this class. The contents of comments are never modified. # ie_hack:: # Needed for conformity to the child API, but not used by this class. def write( output, indent=-1, transitive=false, ie_hack=false ) Kernel.warn("Comment.write is deprecated. See REXML::Formatters", uplevel: 1) indent( output, indent ) output << START output << @string output << STOP end alias :to_s :string ## # Compares this Comment to another; the contents of the comment are used # in the comparison. def <=>(other) other.to_s <=> @string end ## # Compares this Comment to another; the contents of the comment are used # in the comparison. def ==( other ) other.kind_of? Comment and (other <=> self) == 0 end def node_type :comment end end end #vim:ts=2 sw=2 noexpandtab: