Class: ConfKit::WikiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/confkit/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth_info, rpc_client = XMLRPC::Client) ⇒ WikiClient

Returns a new instance of WikiClient.



11
12
13
14
# File 'lib/confkit/base.rb', line 11

def initialize(auth_info, rpc_client=XMLRPC::Client)
  @client = rpc_client.new2(auth_info[:url])
  @token = @client.call('confluence1.login', auth_info[:login], auth_info[:password])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(methodname, *args) ⇒ Object



16
17
18
# File 'lib/confkit/base.rb', line 16

def method_missing(methodname, *args)
  @client.call("confluence1.#{methodname.to_s}", @token, *args)
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



9
10
11
# File 'lib/confkit/base.rb', line 9

def token
  @token
end

Class Method Details

.from_configObject



22
23
24
25
# File 'lib/confkit/base.rb', line 22

def from_config
  auth = YAML.load_file(File.expand_path('~/.confkitrc'))
  WikiClient.new(auth)
end