Sha256: 25e6e7a6449721dbae6362f65ba981070b90df4fbe59de575185c2663ec41866

Contents?: true

Size: 734 Bytes

Versions: 6

Compression:

Stored size: 734 Bytes

Contents

module Nuorder
  module Default

    # Default API endpoint
    API_ENDPOINT = 'http://buyer.nuorder.com'.freeze

    # If no callback provided the value must be "oob"
    NO_CALLBACK = 'oob'.freeze

    # Default App Name
    APP_NAME = 'Springboard Retail'.freeze

    class << self

      def options
        Hash[Nuorder::Configurable.keys.map { |key| [key, default_value(key)] }]
      end

      def app_name
        APP_NAME
      end

      def api_endpoint
        API_ENDPOINT
      end

      def oauth_callback
        NO_CALLBACK
      end

      private

      # Gets the default value if present or an empty string
      def default_value(key)
        self.respond_to?(key) ? send(key) : ''
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nuorder-1.3.1 lib/nuorder/default.rb
nuorder-1.3.0 lib/nuorder/default.rb
nuorder-1.2.0 lib/nuorder/default.rb
nuorder-1.1.0 lib/nuorder/default.rb
nuorder-1.0.1 lib/nuorder/default.rb
nuorder-1.0.0 lib/nuorder/default.rb