Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor core Ruby module API #71

Closed
razor-x opened this issue Aug 5, 2024 · 0 comments · Fixed by #89
Closed

Refactor core Ruby module API #71

razor-x opened this issue Aug 5, 2024 · 0 comments · Fixed by #89

Comments

@razor-x
Copy link
Contributor

razor-x commented Aug 5, 2024

          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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant