Method: Wordpress::Post#initialize

Defined in:
lib/wordpress.rb

#initialize(usr, pwd, login_url = DEFAULT_URL) ⇒ Post

Returns a new instance of Post.

Raises:



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/wordpress.rb', line 24

def initialize usr, pwd,  = DEFAULT_URL
  raise   AuthError, "Blank Username or Password or not a string." \
    unless  usr.is_a?(String) && pwd.is_a?(String) && !usr.empty? && !pwd.empty?

  raise   AuthError, "Url should end with wp-login.php" \
    unless   =~ /\/wp-login[.]php$/

  @username  = usr
  @password  = pwd
  @login_url = 
  @agent     = WWW::Mechanize.new
  @post_url  = @tags = @title = @body = nil
end