Sha256: 8ae7b8fd9aa36f2985ee6777ca58b209254a7b1629f17bde2f6bf3f43c3ad75f

Contents?: true

Size: 1.18 KB

Versions: 12

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

module Soaspec
  # Defaults for Soaspec RestParameters methods
  module RestParametersDefaults
    # This must be overridden by using 'base_url' method within class definition
    # @return [String] Set through following method. Base URL in REST requests.
    def base_url_value
      nil
    end

    # This returns the base url that can be accessed by a subclass. It is set by
    # the 'base_url' method
    #
    # @example
    #   class Parent < Soaspec::RestHandler
    #     base_url 'parent'
    #   end
    #
    #   class Child < Parent
    #     base_url "#{parent_url}/child_path"
    #   end
    #
    #   Child.new.base_url_value # => 'parent/child_path'
    # @return [String] Base url that can be accessed by a subclass.
    def parent_url
      raise 'This needs to be set through base_url method'
    end

    # @return [Hash] Headers used in RestClient
    def rest_client_headers
      {}
    end

    # Whether to convert each key in the request to PascalCase
    # It will also auto convert simple XPath, JSONPath where '//' or '..' not specified
    # @return [Boolean] Whether to convert to PascalCase
    def pascal_keys?
      false
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
soaspec-0.3.11 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.10 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.9 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.8 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.7 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.6 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.3 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.2 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.3.1 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.32 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.31 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.30 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb