Sha256: 28dc1a9472331ccf7c43b0d400f008c4cd200907a6b8a3ea50e26da6da4ad85f

Contents?: true

Size: 893 Bytes

Versions: 1

Compression:

Stored size: 893 Bytes

Contents

require "fog"

module Opennorth
  class Represent < Fog::Service
    # Your code goes here...
    VERSION = File.read(File.join(File.dirname(__FILE__),"..","..","VERSION"))

    BASE_URL = "http://represent.opennorth.ca".freeze

    request_path "opennorth/represent/requests"
    request :get_postal_code

    model_path 'opennorth/represent/models'
    collection :postal_codes
    model :postal_code

    class Real
      def initialize(options={})
        @connection = Fog::Connection.new(BASE_URL,false,connection_options)
      end

      def request(options={})
        connection.request(options)
      end

      private
      attr_reader :connection

      def connection_options
        options = {}
        options.merge!(proxy: ENV["FOG_PROXY"]) if ENV["FOG_PROXY"]
        options
      end

    end

    class Mock
      def initialize(options={})

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opennorth-represent-0.1.0 lib/opennorth/represent.rb