Sha256: 0fe80f3d402b1624c3c2f217d3d8c4fda6fd960a3186df9032d0129954f429cb

Contents?: true

Size: 1.06 KB

Versions: 53

Compression:

Stored size: 1.06 KB

Contents

class Ey::Core::Client
  class Real
    def cancel_account(resource_id, requested_by_id)
      request(
        :method => :post,
        :path   => "account_cancellations",
        :params => {"requested_by_id" => requested_by_id, "account_id" => resource_id},
      )
    end
  end # Real

  class Mock
    def cancel_account(resource_id, requested_by_id)
      self.data[:accounts][resource_id]['cancelled_at'] = Time.now
      account_cancellation_id = self.uuid
      self.data[:accounts][resource_id]['cancellation'] = url_for("/account_cancellations/#{account_cancellation_id}")
      cancellation = {
        "id" => account_cancellation_id,
        "created_at" => Time.now,
        "kind" => "self",
      }
      self.data[:account_cancellations]||= {}
      self.data[:account_cancellations][account_cancellation_id] = cancellation
      response(
        :body    => {"cancellation" => cancellation},
        :status  => 200,
        :headers => {
          "Content-Type" => "application/json; charset=utf8"
        }
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/requests/cancel_account.rb
ey-core-3.6.3 lib/ey-core/requests/cancel_account.rb
ey-core-3.6.1 lib/ey-core/requests/cancel_account.rb
groove-ey-core-3.6.3 lib/ey-core/requests/cancel_account.rb
groove-ey-core-3.6.2 lib/ey-core/requests/cancel_account.rb
groove-ey-core-3.6.1 lib/ey-core/requests/cancel_account.rb
ey-core-3.5.0 lib/ey-core/requests/cancel_account.rb
ey-core-3.4.4 lib/ey-core/requests/cancel_account.rb
ey-core-3.4.2 lib/ey-core/requests/cancel_account.rb
ey-core-3.4.1 lib/ey-core/requests/cancel_account.rb
ey-core-3.4.0 lib/ey-core/requests/cancel_account.rb
ey-core-3.3.1 lib/ey-core/requests/cancel_account.rb
ey-core-3.3.0 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.6 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.5 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.4 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.3 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.2 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.1 lib/ey-core/requests/cancel_account.rb
ey-core-3.2.0 lib/ey-core/requests/cancel_account.rb