lib/magento/base.rb in magentor-0.2.18 vs lib/magento/base.rb in magentor-0.3.0

- old
+ new

@@ -13,11 +13,15 @@ module ClassMethods # Uses the classes name and method to make an rpc call through connection def commit(method, *args) # TODO: need to catch errors sent back from magento and bubble them up appropriately - method = "#{to_s.split('::').last.underscore.downcase}.#{method}" + method = "#{api_path}.#{method}" Magento::Base.connection.call(method, *args) + end + + def api_path + to_s.split('::').last.underscore.downcase end end module InstanceMethods def initialize(attributes = {}) \ No newline at end of file