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 735
735:     def initialize(text, name)
736:       super()
737:       @text = text
738:       @name = name
739:       @token_stream  = nil
740:       @visibility    = :public
741:       @dont_rename_initialize = false
742:       @block_params  = nil
743:       @aliases       = []
744:       @is_alias_for  = nil
745:       @comment = ""
746:       @call_seq = nil
747:       @doc_priority = 50
748:     end

Public Instance methods

[Source]

     # File parsers/parse_f95.rb, line 756
756:     def <=>(other)
757:       if @doc_priority < 1 && other.doc_priority < 1
758:         t = @doc_priority <=> other.doc_priority
759:         return t if t != 0
760:       elsif @doc_priority < 1 && other.doc_priority >= 1
761:         return -1
762:       elsif @doc_priority >= 1 && other.doc_priority < 1
763:         return 1
764:       end
765: 
766:       if @doc_priority > 99 && other.doc_priority > 99
767:         t = @doc_priority <=> other.doc_priority
768:         return t if t != 0
769:       elsif @doc_priority > 99 && other.doc_priority <= 99
770:         return 1
771:       elsif @doc_priority <= 99 && other.doc_priority > 99
772:         return -1
773:       end
774: 
775:       t = @name <=> other.name
776:       return t if t != 0
777:       t = @doc_priority <=> other.doc_priority
778:       return t if t != 0
779:       t = @params <=> other.params
780:       return t if t != 0
781:       t = @comment <=> other.comment
782:     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 750
750:     def set_priority(doc_priority)
751:       if doc_priority.class.to_s == 'Fixnum'
752:         @doc_priority = doc_priority
753:       end
754:     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]