Sha256: c5be79ceadca05d9ea860a984194d9855c1b7a64f1c466db168b3923d329b824

Contents?: true

Size: 685 Bytes

Versions: 2

Compression:

Stored size: 685 Bytes

Contents

module Paid
  class Subscription < APIResource
    # attributes :id and :object inherited from APIResource
    attribute :created_at
    attribute :starts_on
    attribute :next_transaction_on
    attribute :plan, Plan
    attribute :customer
    attribute :started_at
    attribute :ended_at
    attribute :cancelled_at

    api_class_method :all, :get, :constructor => APIList.constructor(Subscription)
    api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
    api_class_method :create, :post

    api_instance_method :cancel, :post, ":path/cancel"

    def self.path
      "/v0/subscriptions"
    end

    APIClass.register_subclass(self, "subscription")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paid-1.0.1 lib/paid/subscription.rb
paid-1.0.0 lib/paid/subscription.rb