Sha256: 143c67708bfbe5e47c89325ef628482852e9a4e8da20cd62d1db74450bd71058

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

module Paid
  class Event < APIResource
    attr_reader :id
    attr_reader :object
    attr_reader :created_at
    attr_reader :type
    attr_reader :data

    def self.all(params={}, headers={})
      method = APIMethod.new(:get, "/events", params, headers, self)
      APIList.new(self, method.execute, method)
    end

    def self.retrieve(id, params={}, headers={})
      params = ParamsBuilder.merge(params, {
        :id => id
      })
      method = APIMethod.new(:get, "/events/:id", params, headers, self)
      self.new(method.execute, method)
    end

    def refresh(params={}, headers={})
      method = APIMethod.new(:get, "/events/:id", params, headers, self)
      self.refresh_from(method.execute, method)
    end

    # Everything below here is used behind the scenes.
    APIResource.register_api_subclass(self, "event")
    @api_attributes = {
      :id => { :readonly => true },
      :object => { :readonly => true },
      :created_at => { :readonly => true },
      :type => { :readonly => true },
      :data => { :constructor => :EventData, :readonly => true },
    }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
paid-1.2.1 lib/paid/event.rb
paid-1.2.0 lib/paid/event.rb
paid-1.1.4 lib/paid/event.rb
paid-1.1.3 lib/paid/event.rb
paid-1.1.2 lib/paid/event.rb
paid-1.1.1 lib/paid/event.rb
paid-1.1.0 lib/paid/event.rb
paid-1.0.11 lib/paid/event.rb
paid-1.0.10 lib/paid/event.rb
paid-1.0.9 lib/paid/event.rb
paid-1.0.8 lib/paid/event.rb
paid-1.0.7 lib/paid/event.rb
paid-1.0.6 lib/paid/event.rb
paid-1.0.5 lib/paid/event.rb
paid-1.0.3 lib/paid/event.rb
paid-1.0.2 lib/paid/event.rb