Sha256: 89c12253300372d31eec94a1d3feeb050a36cd1627e61589d212ab17b1cfc09c

Contents?: true

Size: 715 Bytes

Versions: 7

Compression:

Stored size: 715 Bytes

Contents

require "omise/object"
require "omise/list"
require "omise/occurrence_list"

module Omise
  class Schedule < OmiseObject
    self.endpoint = "/schedules"

    def self.list(attributes = {})
      List.new resource(location, attributes).get(attributes)
    end

    def self.retrieve(id, attributes = {})
      new resource(location(id), attributes).get(attributes)
    end

    def self.create(attributes = {})
      new resource(location, attributes).post(attributes)
    end

    def occurrences
      list_attribute OccurrenceList, "occurrences"
    end

    def destroy(attributes = {})
      assign_attributes resource(attributes).delete
    end

    def destroyed?
      status == "deleted"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
omise-0.11.0 lib/omise/schedule.rb
omise-0.10.1 lib/omise/schedule.rb
omise-0.10.0 lib/omise/schedule.rb
omise-0.9.1 lib/omise/schedule.rb
omise-0.9.0 lib/omise/schedule.rb
omise-0.7.2 lib/omise/schedule.rb
omise-0.8.0 lib/omise/schedule.rb