Sha256: cdb5c1523e9342a700b12e3078ae2dd10bb24f64a172a71379fee1584fa1d273

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
soaspec-0.2.29 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.28 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.27 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.26 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb
soaspec-0.2.25 lib/soaspec/exchange_handlers/rest_parameters_defaults.rb