Class: WpWrapper::Client

Inherits:
Object
  • Object
show all
Includes:
Modules::Api, Modules::Authorization, Modules::Options, Modules::Plugins, Modules::Profiles, Modules::Setup, Modules::Themes, Modules::Upgrade
Defined in:
lib/wp_wrapper/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Modules::Api

#enable_xml_rpc_api

Methods included from Modules::Profiles

#add_user, #change_display_name, #change_profile_password, #update_profile

Methods included from Modules::Options

#disable_comments_and_trackbacks, #set_blog_description, #set_options

Methods included from Modules::Plugins

#manage_plugin, #manage_plugins

Methods included from Modules::Plugins::TrackingCode

#configure_tracking_code

Methods included from Modules::Plugins::WordpressSeo

#configure_wordpress_seo, #configure_wordpress_seo_sitemaps, #get_author_options, #get_taxonomy_options, #get_title_options, #translate_pattern

Methods included from Modules::Plugins::W3TotalCache

#activate_configuration, #configure_browser_cache, #configure_general_settings, #configure_minification, #configure_page_cache, #configure_w3_total_cache

Methods included from Modules::Plugins::Gocodes

#configure_gocodes

Methods included from Modules::Plugins::Akismet

#configure_akismet

Methods included from Modules::Themes

#activate_random_theme, #activate_theme, #get_theme_links, #perform_activation

Methods included from Modules::Upgrade

#get_upgrade_form_identifier, #upgrade, #upgrade_core, #upgrade_database, #upgrade_plugins, #upgrade_themes, #upgrade_themes_or_plugins

Methods included from Modules::Setup

#set_permalinks_options, #set_setup_form_options, #setup

Methods included from Modules::Authorization

#login

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/wp_wrapper/client.rb', line 7

def initialize(options = {})
  options.symbolize_keys! if options.respond_to?(:symbolize_keys!)
  
  self.url                =   options.fetch(:url, nil)
  self.url                =   "#{self.url}/" unless self.url.nil? || self.url =~ /\/$/i
  
  self.username           =   options.fetch(:username, nil)
  self.password           =   options.fetch(:password, nil)
  self.logged_in          =   false
  
  self.http_client        =   HttpUtilities::Http::Client.new
  self.mechanize_client   =   HttpUtilities::Http::Mechanize::Client.new
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



4
5
6
# File 'lib/wp_wrapper/client.rb', line 4

def environment
  @environment
end

#http_clientObject

Returns the value of attribute http_client.



5
6
7
# File 'lib/wp_wrapper/client.rb', line 5

def http_client
  @http_client
end

#logged_inObject

Returns the value of attribute logged_in.



4
5
6
# File 'lib/wp_wrapper/client.rb', line 4

def logged_in
  @logged_in
end

#mechanize_clientObject

Returns the value of attribute mechanize_client.



5
6
7
# File 'lib/wp_wrapper/client.rb', line 5

def mechanize_client
  @mechanize_client
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/wp_wrapper/client.rb', line 3

def password
  @password
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/wp_wrapper/client.rb', line 3

def url
  @url
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/wp_wrapper/client.rb', line 3

def username
  @username
end