| Class | RDoc::AnyMethod |
| In: |
code_objects.rb
parsers/parse_f95.rb doc-tmp/rdoc/code_objects.rb |
| Parent: | CodeObject |
AnyMethod is the base class for objects representing methods
# 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
# File doc-tmp/rdoc/code_objects.rb, line 648
648: def initialize(text, name)
649: super()
650: @text = text
651: @name = name
652: @token_stream = nil
653: @visibility = :public
654: @dont_rename_initialize = false
655: @block_params = nil
656: @aliases = []
657: @is_alias_for = nil
658: @comment = ""
659: @call_seq = nil
660: end
# File code_objects.rb, line 648
648: def initialize(text, name)
649: super()
650: @text = text
651: @name = name
652: @token_stream = nil
653: @visibility = :public
654: @dont_rename_initialize = false
655: @block_params = nil
656: @aliases = []
657: @is_alias_for = nil
658: @comment = ""
659: @call_seq = nil
660: end
# 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
# File doc-tmp/rdoc/code_objects.rb, line 662
662: def <=>(other)
663: @name <=> other.name
664: end
# File doc-tmp/rdoc/code_objects.rb, line 694
694: def add_alias(method)
695: @aliases << method
696: end
# File code_objects.rb, line 672
672: def param_seq
673: p = params.gsub(/\s*\#.*/, '')
674: p = p.tr("\n", " ").squeeze(" ")
675: p = "(" + p + ")" unless p[0] == ?(
676:
677: if (block = block_params)
678: # If this method has explicit block parameters, remove any
679: # explicit &block
680: $stderr.puts p
681: p.sub!(/,?\s*&\w+/)
682: $stderr.puts p
683:
684: block.gsub!(/\s*\#.*/, '')
685: block = block.tr("\n", " ").squeeze(" ")
686: if block[0] == ?(
687: block.sub!(/^\(/, '').sub!(/\)/, '')
688: end
689: p << " {|#{block}| ...}"
690: end
691: p
692: end
# File doc-tmp/rdoc/code_objects.rb, line 672
672: def param_seq
673: p = params.gsub(/\s*\#.*/, '')
674: p = p.tr("\n", " ").squeeze(" ")
675: p = "(" + p + ")" unless p[0] == ?(
676:
677: if (block = block_params)
678: # If this method has explicit block parameters, remove any
679: # explicit &block
680: $stderr.puts p
681: p.sub!(/,?\s*&\w+/)
682: $stderr.puts p
683:
684: block.gsub!(/\s*\#.*/, '')
685: block = block.tr("\n", " ").squeeze(" ")
686: if block[0] == ?(
687: block.sub!(/^\(/, '').sub!(/\)/, '')
688: end
689: p << " {|#{block}| ...}"
690: end
691: p
692: end
# 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