Changeset 4

Show
Ignore:
Timestamp:
07/01/06 17:35:59 (3 years ago)
Author:
imperator
Message:

Added the Entry#fields method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • www-raa/lib/net/raa.rb

    r3 r4  
    1515          @project = project 
    1616          @mech = WWW::Mechanize.new 
    17           @mech.get("http://raa.ruby-lang.org/update.rhtml?name=#{project}") 
     17          @mech.get(HOME_PAGE + "/update.rhtml?name=#{project}") 
    1818          @form = @mech.page.forms[1] 
    1919          yield self if block_given? 
     20        end 
     21         
     22        # Returns an array of form field names. 
     23        # 
     24        def fields 
     25          @form.fields.map{ |field| field.inspect.split('=').first.strip } 
    2026        end 
    2127 
     
    3642end 
    3743 
    38 a = WWW::RAA::Entry.new("dummy") { |e| e.email "a@a.com"; p e.email } 
     44a = WWW::RAA::Entry.new('dummy') 
     45p a.fields