Class: Webmaster::Client

Inherits:
Base show all
Defined in:
lib/webmaster/client.rb

Constant Summary

Constants included from Api::Request

Api::Request::METHODS, Api::Request::METHODS_WITH_BODIES

Constants included from Api::Connection

Api::Connection::ACCEPT, Api::Connection::ACCEPT_CHARSET, Api::Connection::ALLOWED_OPTIONS, Api::Connection::CONTENT_TYPE, Api::Connection::USER_AGENT

Instance Attribute Summary

Attributes inherited from Base

#configuration

Attributes included from Api::Authorization

#scopes

Instance Method Summary collapse

Methods inherited from Base

#arguments, #attributes=, #initialize, #inspect, #method_missing, #set, #with

Methods included from Api::Request

#delete_request, #get_request, #post_request, #put_request, #request

Methods included from Api::Connection

#connection

Methods included from Api::Authorization

#auth_code, #authenticate, #authenticated?, #authorize_url, #oauth, #token

Constructor Details

This class inherits a constructor from Webmaster::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Webmaster::Base

Instance Method Details

#create_host(name) ⇒ Object



10
11
12
13
# File 'lib/webmaster/client.rb', line 10

def create_host(name)
  xml = "<host><name>#{name}</name></host>"
  self.request(:post, '/hosts', xml)
end

#hosts(reload = false) ⇒ Object



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

def hosts(reload = false)      
  @hosts = nil if reload
  @hosts ||= self.objects_from_response(Webmaster::Host, self.request(:get, '/hosts'), :host)      
end