Sha256: c680375baba62f93df29026b83c3e3def65c2210ff1bd1c892915fc110075d85

Contents?: true

Size: 609 Bytes

Versions: 2

Compression:

Stored size: 609 Bytes

Contents

module Paid
  class Event < APIResource
    class Data
      def self.construct(json={})
        return nil if json.nil?
        klass = APIClass.subclass_fetch(json[:object])
        klass.construct(json)
      end
    end

    # attributes :id and :object inherited from APIResource
    attribute :created_at
    attribute :type
    attribute :data, Data

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


    def self.path
      "/v0/events"
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

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