Class: ConfKit::WikiClient
- Inherits:
-
Object
- Object
- ConfKit::WikiClient
- Defined in:
- lib/confkit/base.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(auth_info, rpc_client = XMLRPC::Client) ⇒ WikiClient
constructor
A new instance of WikiClient.
- #method_missing(methodname, *args) ⇒ Object
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
#token ⇒ Object (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_config ⇒ Object
22 23 24 25 |
# File 'lib/confkit/base.rb', line 22 def from_config auth = YAML.load_file(File.('~/.confkitrc')) WikiClient.new(auth) end |