Sha256: 56052df375900864677ff4763197b228fea966a5f6effd1b3c4306e1a260b58d

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

module Spree
  module API
    module URI
      def self.included(base)
        base.send :define_method, "#{base.resource_name_plural}_uri" do
          "#{Spree.endpoint}/#{base.resource_name_plural}"
        end

        base.send :define_method, "#{base.resource_name}_uri" do |id|
          "#{Spree.endpoint}/#{base.resource_name_plural}/#{id}"
        end

        base.send :define_method, "#{base.resource_name}_search_uri" do |query|
          "#{Spree.endpoint}/#{base.resource_name_plural}?#{query}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-wrap-0.0.2 motion/spree/api/uri.rb