Class: Magento::Connection
- Inherits:
-
Object
- Object
- Magento::Connection
- Defined in:
- lib/magento.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #call(method = nil, *args) ⇒ Object
-
#initialize(*args) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(*args) ⇒ Connection
Returns a new instance of Connection.
13 14 15 16 17 18 |
# File 'lib/magento.rb', line 13 def initialize(*args) @config = Configuration.new @client = XMLRPC::Client.new(@config.host,@config.path,@config.port) @session = @client.call("login", @config.username, @config.api_key) self end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
12 13 14 |
# File 'lib/magento.rb', line 12 def client @client end |
Instance Method Details
#call(method = nil, *args) ⇒ Object
20 21 22 |
# File 'lib/magento.rb', line 20 def call(method = nil, *args) client.call("call",@session, method, args) end |