Sha256: 943087c2e9ddfec670500199d72a59c52e4a6d16889b8fcc48a91ead269a969b

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

require 'magento_remote'

module Rawbotz
  def self.mech
    settings = (YAML.load_file Rawbotz.conf_file_path)["remote_shop"]
    mech = MagentoMech.new settings["base_uri"]
    mech.pass = settings["pass"]
    mech.user = settings["user"]
    mech.login
    mech
  end
  def self.attribute_ids
    @@attribute_ids ||= (YAML.load_file Rawbotz.conf_file_path)["attribute_ids"]
  end
  module RemoteShop
    def self.product_page_url(product, settings)
      # settings could be memoized
      "#{settings['remote_shop']['base_uri']}catalog/product/view/id/#{product.product_id}"
    end
    def self.cart_page_url(settings)
      "#{settings['remote_shop']['base_uri']}checkout/cart/"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rawbotz-0.2.0 lib/rawbotz/remote_shop.rb