Class RDoc::AnyMethod
In: code_objects.rb
parsers/parse_f95.rb
Parent: CodeObject

Extend AnyMethod class for parse_f95.rb Original class is defined in code_objects.rb.

  • A method "<=>" is modified.

Methods

<=>   <=>   add_alias   new   new   param_seq   set_priority   to_s  

Included Modules

TokenStream

Attributes

aliases  [R] 
block_params  [RW] 
call_seq  [RW] 
doc_priority  [R] 
dont_rename_initialize  [RW] 
is_alias_for  [RW] 
name  [RW] 
singleton  [RW] 
visibility  [RW] 

Public Class methods

[Source]

     # File code_objects.rb, line 930
930:     def initialize(text, name)
931:       super()
932:       @text = text
933:       @name = name
934:       @token_stream  = nil
935:       @visibility    = :public
936:       @dont_rename_initialize = false
937:       @block_params  = nil
938:       @aliases       = []
939:       @is_alias_for  = nil
940:       @comment = ""
941:       @call_seq = nil
942:     end

[Source]

     # File parsers/parse_f95.rb, line 828
828:     def initialize(text, name)
829:       super()
830:       @text = text
831:       @name = name
832:       @token_stream  = nil
833:       @visibility    = :public
834:       @dont_rename_initialize = false
835:       @block_params  = nil
836:       @aliases       = []
837:       @is_alias_for  = nil
838:       @comment = ""
839:       @call_seq = nil
840:       @doc_priority = 50
841:     end

Public Instance methods

[Source]

     # File parsers/parse_f95.rb, line 849
849:     def <=>(other)
850:       if @doc_priority < 1 && other.doc_priority < 1
851:         t = @doc_priority <=> other.doc_priority
852:         return t if t != 0
853:       elsif @doc_priority < 1 && other.doc_priority >= 1
854:         return -1
855:       elsif @doc_priority >= 1 && other.doc_priority < 1
856:         return 1
857:       end
858: 
859:       if @doc_priority > 99 && other.doc_priority > 99
860:         t = @doc_priority <=> other.doc_priority
861:         return t if t != 0
862:       elsif @doc_priority > 99 && other.doc_priority <= 99
863:         return 1
864:       elsif @doc_priority <= 99 && other.doc_priority > 99
865:         return -1
866:       end
867: 
868:       t = @name <=> other.name
869:       return t if t != 0
870:       t = @doc_priority <=> other.doc_priority
871:       return t if t != 0
872:       t = @params <=> other.params
873:       return t if t != 0
874:       t = @comment <=> other.comment
875:     end

[Source]

     # File code_objects.rb, line 944
944:     def <=>(other)
945:       @name <=> other.name
946:     end

[Source]

     # File code_objects.rb, line 990
990:     def add_alias(method)
991:       @aliases << method
992:     end

[Source]

     # File code_objects.rb, line 968
968:     def param_seq
969:       p = params.gsub(/\s*\#.*/, '')
970:       p = p.tr("\n", " ").squeeze(" ")
971:       p = "(" + p + ")" unless p[0] == ?(
972: 
973:       if (block = block_params)
974:         # If this method has explicit block parameters, remove any
975:         # explicit &block
976: $stderr.puts p
977:         p.sub!(/,?\s*&\w+/)
978: $stderr.puts p
979: 
980:         block.gsub!(/\s*\#.*/, '')
981:         block = block.tr("\n", " ").squeeze(" ")
982:         if block[0] == ?(
983:           block.sub!(/^\(/, '').sub!(/\)/, '')
984:         end
985:         p << " {|#{block}| ...}"
986:       end
987:       p
988:     end

[Source]

     # File parsers/parse_f95.rb, line 843
843:     def set_priority(doc_priority)
844:       if doc_priority.class.to_s == 'Fixnum'
845:         @doc_priority = doc_priority
846:       end
847:     end
 moved to parse_f95.rb #

!# !# def <=>(other) !# t = @name <=> other.name !# return t if t != 0 !# t = @params <=> other.params !# return t if t != 0 !# t = @comment <=> other.comment !# end !#

 moved to parse_f95.rb #

[Source]

     # File code_objects.rb, line 962
962:     def to_s
963:       res = self.class.name + ": " + @name + " (" + @text + ")\n"
964:       res << @comment.to_s
965:       res
966:     end

[Validate]