Object#*methods

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

Object#*methodse$B$,e(BSymbole$BG[Ns$rJV$9$h$&$K$J$C$?$N$H!“e(BSymbole$B$,e(BString
e$B$N%5%V%/%i%9$8$c$J$/$J$C$?$N$H$G!“F0$+$J$/$J$C$?%3!<%I$,$”$ke(B
e$B$h$&$G$9!#e(B
e$B1F6AHO0O$,D4$Y$-$l$J$$$N$G$9$,!”$H$j$"$($:[email protected]$1e(B
e$B%Q%C%A$G$9!#e(B

Index: rss/parser.rb

— rss/parser.rb (revision 11633)
+++ rss/parser.rb (working copy)
@@ -4,7 +4,7 @@
rescue LoadError
require “uri”
end
-unless Kernel.methods.include?(“URI”)
+unless Kernel.methods.include?(:URI)
module Kernel
def URI(uri_str) # :doc:
URI.parse(uri_str)
@@ -230,7 +230,7 @@

   def def_get_text_element(uri, name, file, line)
     register_uri(uri, name)
  •    unless 
    

private_instance_methods(false).include?(“start_#{name}”)

  •    unless 
    

private_instance_methods(false).include?(“start_#{name}”.to_sym)
module_eval(<<-EOT, file, line)
def start_#{name}(name, prefix, attrs, ns)
uri = ns[prefix]
Index: rss/rss.rb

— rss/rss.rb (revision 11633)
+++ rss/rss.rb (working copy)
@@ -25,13 +25,13 @@
end
end

  • unless instance_methods.include?(“w3cdtf”)
  • unless instance_methods.include?(:w3cdtf)
    alias w3cdtf iso8601
    end
    end

module Enumerable

  • unless instance_methods.include?(“sort_by”)
  • unless instance_methods.include?(:sort_by)
    def sort_by
    collect do |x|
    [yield(x), x]
    @@ -45,7 +45,7 @@
    end

class Hash

  • unless instance_methods.include?(“merge”)
  • unless instance_methods.include?(:merge)
    def merge(other)
    dup.update(other)
    end
    @@ -53,7 +53,7 @@
    end

module Kernel

  • unless methods.include?(“funcall”)
  • unless methods.include?(:funcall)
    def funcall(*args, &block)
    send(*args, &block)
    end
    @@ -812,7 +812,7 @@
    def other_element(need_convert, indent=’’)
    rv = []
    private_methods.each do |meth|
  •    if /\A([^_]+)_[^_]+_elements?\z/ =~ meth and
    
  •    if /\A([^_]+)_[^_]+_elements?\z/ =~ meth.to_s and
           self.class::NSPOOL.has_key?($1)
         res = __send__(meth, need_convert, indent)
         rv << res if /\A\s*\z/ !~ res
    

e$B$=$l$G$O!#e(B

[email protected]$G$9!#e(B

At Tue, 6 Feb 2007 03:46:24 +0900,
U.Nakamura wrote in [ruby-dev:30274]:

Object#*methodse$B$,e(BSymbole$BG[Ns$rJV$9$h$&$K$J$C$?$N$H!“e(BSymbole$B$,e(BString
e$B$N%5%V%/%i%9$8$c$J$/$J$C$?$N$H$G!“F0$+$J$/$J$C$?%3!<%I$,$”$ke(B
e$B$h$&$G$9!#e(B
e$B1F6AHO0O$,D4$Y$-$l$J$$$N$G$9$,!”$H$j$"$($:[email protected]$1e(B
e$B%Q%C%A$G$9!#e(B

methods.include? e$B$H$$$&=q$-J}<+BN$,85!9$"$^$j$h$/[email protected]$H;W$$e(B
e$B$^$9$,!"e(B

-unless Kernel.methods.include?(“URI”)
+unless Kernel.methods.include?(:URI)
unless Kernel.respond_to?(:URI)

  • unless instance_methods.include?(“w3cdtf”)
  • unless instance_methods.include?(:w3cdtf)
    unless method_defined?(:w3cdtf)

e$B$O$$$$$H$7$Fe(B

  •    unless private_instance_methods(false).include?("start_#{name}")
    
  •    unless private_instance_methods(false).include?("start_#{name}".to_sym)
    

private_method_defined? e$B$K$O%*%W%7%g%J%k$J0z?t$,$"$j$^$;$s$M!#e(B

e$B0J2<$N;0$D$O$=$b$=$bITMW$G$9!#e(B

module Enumerable

  • unless instance_methods.include?(“sort_by”)
  • unless instance_methods.include?(:sort_by)

class Hash

  • unless instance_methods.include?(“merge”)
  • unless instance_methods.include?(:merge)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs