R/class-ratelimit.R

Defines functions .asRate

# Rate limit
Rate <- setRefClass(
  "Rate",
  contains = "Item",

  fields = list(
    limit = "numeric",
    remaining = "numeric",
    reset = "numeric"
  ),

  methods = list(
    show = function() {
      .showFields(
        .self, "== Rate Limit ==",
        values = c("limit", "remaining", "reset")
      )
    }
  )
)

.asRate <- function(x) {
  Rate(
    limit = x$rate$limit,
    remaining = x$rate$remaining,
    reset = x$rate$reset,
    response = response(x)
  )
}

Try the sevenbridges package in your browser

Any scripts or data that you put into this service are public.

sevenbridges documentation built on March 25, 2021, 6 p.m.