Class: WpWrapper::Client
- Inherits:
-
Object
- Object
- WpWrapper::Client
- 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
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#http_client ⇒ Object
Returns the value of attribute http_client.
-
#logged_in ⇒ Object
Returns the value of attribute logged_in.
-
#mechanize_client ⇒ Object
Returns the value of attribute mechanize_client.
-
#password ⇒ Object
Returns the value of attribute password.
-
#reraise_exceptions ⇒ Object
Returns the value of attribute reraise_exceptions.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Modules::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
Methods included from Modules::Plugins::WordpressSeo
#configure_wordpress_seo, #configure_wordpress_seo_advanced_options, #configure_wordpress_seo_permalinks, #configure_wordpress_seo_sitemaps, #configure_wordpress_seo_titles, #enable_wordpress_seo_settings_page
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
Methods included from Modules::Plugins::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
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/wp_wrapper/client.rb', line 8 def initialize( = {}) .symbolize_keys! if .respond_to?(:symbolize_keys!) self.url = .fetch(:url, nil) self.url = "#{self.url}/" unless self.url.nil? || self.url =~ /\/$/i self.username = .fetch(:username, nil) self.password = .fetch(:password, nil) self.logged_in = false self.http_client = HttpUtilities::Http::Client.new self.mechanize_client = HttpUtilities::Http::Mechanize::Client.new self.reraise_exceptions = .fetch(:reraise_exceptions, false) end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/wp_wrapper/client.rb', line 4 def environment @environment end |
#http_client ⇒ Object
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_in ⇒ Object
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_client ⇒ Object
Returns the value of attribute mechanize_client.
5 6 7 |
# File 'lib/wp_wrapper/client.rb', line 5 def mechanize_client @mechanize_client end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/wp_wrapper/client.rb', line 3 def password @password end |
#reraise_exceptions ⇒ Object
Returns the value of attribute reraise_exceptions.
6 7 8 |
# File 'lib/wp_wrapper/client.rb', line 6 def reraise_exceptions @reraise_exceptions end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/wp_wrapper/client.rb', line 3 def url @url end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/wp_wrapper/client.rb', line 3 def username @username end |