Refactor core Ruby module API
Closed this issue · 0 comments
razor-x commented
Ruby allows for very expressive libraries. Let's hide the internals from the users and build on the `Seam` module.
So,
module Seam
def self.new(**args)
Http.new(**args)
end
def from_api_key
end
def from_personal_access_token
end
# Expose lts_version and version here
end
Errors are Seam::HttpApiError
and Seam::ActionAttemptTimeoutError
, etc as those are shared by things in the module.
The invalid option errors should be class level though, so Seam:Http::InvalidOptionsError
(these errors are internal, the user is not meant to really catch them and handle them).
The other classes must be accessed directly, e.g., Seam::Webhook.new
and Seam::HttpMultiWorkspace.new
.
Originally posted by @razor-x in #61 (comment)