<commit_before>

# encoding: utf-8
#
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#
require 'uri'

module GoCardlessPro
  # A module containing classes for each of the resources in the GC Api
  module Resources
    # Redirect flows enable you to use GoCardless Pro's secure payment pages to
    # set up mandates with your customers.
    #
    # The overall flow is:
    #
    #
    # 1. You [create](#create-a-redirect-flow) a redirect flow for your customer,
    # and redirect them to the returned redirect url, e.g.
    # `https://pay.gocardless.com/flow/RE123`.
    #
    # 2. Your customer supplies
    # their name, email, address, and bank account details, and submits the form.
    # This securely stores their details, and redirects them back to your
    # `success_redirect_url` with `redirect_flow_id=RE123` in the querystring.
    #
    #
    # 3. You [complete](#complete-a-redirect-flow) the redirect flow, which
    # creates a [customer](#core-endpoints-customers), [customer bank
    # account](#core-endpoints-customer-bank-accounts), and
    # [mandate](#core-endpoints-mandates), and returns the ID of the mandate. You
    # may wish to create a [subscription](#core-endpoints-subscriptions) or
    # [payment](#core-endpoints-payments) at this point.
    #
    # It is
    # recommended that you link the redirect flow to your user object as soon as
    # it is created, and attach the created resources to that user in the complete
    # step.
    #
    # Redirect flows expire 30 minutes after they are first
    # created. You cannot [complete](#complete-a-redirect-flow) an expired
    # redirect flow.
    #
    # [View an example
    # integration](https://pay-sandbox.gocardless.com/AL000000AKFPFF) that uses
    # redirect flows.
    # Represents an instance of a redirect_flow resource returned from the API
    class RedirectFlow
      attr_reader :created_at

      attr_reader :description

      attr_reader :id

      attr_reader :redirect_url

      attr_reader :scheme

      attr_reader :session_token

      attr_reader :success_redirect_url
      # initialize a resource instance
      # @param object [Hash] an object returned from the API
      def initialize(object)
        @object = object

        @created_at = object['created_at']
        @description = object['description']
        @id = object['id']
        @links = object['links']
        @redirect_url = object['redirect_url']
        @scheme = object['scheme']
        @session_token = object['session_token']
        @success_redirect_url = object['success_redirect_url']
      end

      # return the links that the resource has
      def links
        Struct.new(
          *{

            creditor: '',

            mandate: ''

          }.keys.sort
        ).new(*@links.sort.map(&:last))
      end

      # Provides the resource as a hash of all it's readable attributes
      def to_h
        @object
      end
    end
  end
end
<commit_msg>Crankshaft Build #BU0000015DCCZ2 @ 2015-06-26 08:06:13 +0000<commit_after>

# encoding: utf-8
#
# WARNING: Do not edit by hand, this file was generated by Crank:
#
#   https://github.com/gocardless/crank
#
require 'uri'

module GoCardlessPro
  # A module containing classes for each of the resources in the GC Api
  module Resources
    # Redirect flows enable you to use GoCardless Pro's [hosted payment
    # pages](https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up mandates
    # with your customers. These pages are fully compliant and have been
    # translated into Dutch, French, German, Italian, Portuguese and Spanish.
    #
    #
    # The overall flow is:
    #
    # 1. You [create](#create-a-redirect-flow)
    # a redirect flow for your customer, and redirect them to the returned
    # redirect url, e.g. `https://pay.gocardless.com/flow/RE123`.
    #
    # 2. Your
    # customer supplies their name, email, address, and bank account details, and
    # submits the form. This securely stores their details, and redirects them
    # back to your `success_redirect_url` with `redirect_flow_id=RE123` in the
    # querystring.
    #
    # 3. You [complete](#complete-a-redirect-flow) the
    # redirect flow, which creates a [customer](#core-endpoints-customers),
    # [customer bank account](#core-endpoints-customer-bank-accounts), and
    # [mandate](#core-endpoints-mandates), and returns the ID of the mandate. You
    # may wish to create a [subscription](#core-endpoints-subscriptions) or
    # [payment](#core-endpoints-payments) at this point.
    #
    # It is
    # recommended that you link the redirect flow to your user object as soon as
    # it is created, and attach the created resources to that user in the complete
    # step.
    #
    # Redirect flows expire 30 minutes after they are first
    # created. You cannot complete an expired redirect flow.
    # Represents an instance of a redirect_flow resource returned from the API
    class RedirectFlow
      attr_reader :created_at

      attr_reader :description

      attr_reader :id

      attr_reader :redirect_url

      attr_reader :scheme

      attr_reader :session_token

      attr_reader :success_redirect_url
      # initialize a resource instance
      # @param object [Hash] an object returned from the API
      def initialize(object)
        @object = object

        @created_at = object['created_at']
        @description = object['description']
        @id = object['id']
        @links = object['links']
        @redirect_url = object['redirect_url']
        @scheme = object['scheme']
        @session_token = object['session_token']
        @success_redirect_url = object['success_redirect_url']
      end

      # return the links that the resource has
      def links
        Struct.new(
          *{

            creditor: '',

            mandate: ''

          }.keys.sort
        ).new(*@links.sort.map(&:last))
      end

      # Provides the resource as a hash of all it's readable attributes
      def to_h
        @object
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08786885245901639, 'fraction_numerical': 0.010163934426229508, 'mean_word_length': 2.6841787439613527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2549615', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1694, 'n_words': 602}