Skip to content

Commit d19524a

Browse files
chore: explicitly mark apis public under Internal module
1 parent 50771fd commit d19524a

22 files changed

Lines changed: 137 additions & 12 deletions

.yardopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--type-name-tag generic:Generic
2+
--default-return void
23
--markup markdown
34
--markup-provider redcarpet
45
--exclude /rbi

lib/orb/client.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ class Client < Orb::Internal::Transport::BaseClient
9191
def initialize(
9292
api_key: ENV["ORB_API_KEY"],
9393
base_url: ENV["ORB_BASE_URL"],
94-
max_retries: DEFAULT_MAX_RETRIES,
95-
timeout: DEFAULT_TIMEOUT_IN_SECONDS,
96-
initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY,
97-
max_retry_delay: DEFAULT_MAX_RETRY_DELAY,
94+
max_retries: Orb::Client::DEFAULT_MAX_RETRIES,
95+
timeout: Orb::Client::DEFAULT_TIMEOUT_IN_SECONDS,
96+
initial_retry_delay: Orb::Client::DEFAULT_INITIAL_RETRY_DELAY,
97+
max_retry_delay: Orb::Client::DEFAULT_MAX_RETRY_DELAY,
9898
idempotency_header: "Idempotency-Key"
9999
)
100100
base_url ||= "https://api.withorb.com/v1"

lib/orb/internal.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# frozen_string_literal: true
22

33
module Orb
4-
# @api private
54
module Internal
65
OMIT =
76
Object.new.tap do

lib/orb/internal/type/array_of.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ class ArrayOf
3030
# @option spec [Boolean] :"nil?"
3131
def self.[](...) = new(...)
3232

33+
# @api public
34+
#
3335
# @param other [Object]
3436
#
3537
# @return [Boolean]
3638
def ===(other) = other.is_a?(Array) && other.all?(item_type)
3739

40+
# @api public
41+
#
3842
# @param other [Object]
3943
#
4044
# @return [Boolean]
@@ -44,6 +48,8 @@ def ==(other)
4448
# rubocop:enable Layout/LineLength
4549
end
4650

51+
# @api public
52+
#
4753
# @return [Integer]
4854
def hash = [self.class, item_type].hash
4955

lib/orb/internal/type/base_model.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,30 @@ def optional(name_sym, type_info, spec = {})
159159
@mode = nil
160160
end
161161

162+
# @api public
163+
#
162164
# @param other [Object]
163165
#
164166
# @return [Boolean]
165167
def ==(other)
166168
other.is_a?(Class) && other <= Orb::Internal::Type::BaseModel && other.fields == fields
167169
end
168170

171+
# @api public
172+
#
169173
# @return [Integer]
170174
def hash = fields.hash
171175
end
172176

177+
# @api public
178+
#
173179
# @param other [Object]
174180
#
175181
# @return [Boolean]
176182
def ==(other) = self.class == other.class && @data == other.to_h
177183

184+
# @api public
185+
#
178186
# @return [Integer]
179187
def hash = [self.class, @data].hash
180188

@@ -291,6 +299,8 @@ def dump(value, state:)
291299
end
292300
end
293301

302+
# @api public
303+
#
294304
# Returns the raw value associated with the given key, if found. Otherwise, nil is
295305
# returned.
296306
#
@@ -309,6 +319,8 @@ def [](key)
309319
@data[key]
310320
end
311321

322+
# @api public
323+
#
312324
# Returns a Hash of the data underlying this object. O(1)
313325
#
314326
# Keys are Symbols and values are the raw values from the response. The return
@@ -361,11 +373,15 @@ def walk(model)
361373
end
362374
end
363375

376+
# @api public
377+
#
364378
# @param a [Object]
365379
#
366380
# @return [String]
367381
def to_json(*a) = Orb::Internal::Type::Converter.dump(self.class, self).to_json(*a)
368382

383+
# @api public
384+
#
369385
# @param a [Object]
370386
#
371387
# @return [String]
@@ -407,7 +423,7 @@ def inspect(depth: 0)
407423
end
408424
end
409425

410-
# @api private
426+
# @api public
411427
#
412428
# @return [String]
413429
def to_s = self.class.walk(@data).to_s

lib/orb/internal/type/base_page.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@
33
module Orb
44
module Internal
55
module Type
6+
# @api private
7+
#
68
# @generic Elem
79
#
810
# This module provides a base implementation for paginated responses in the SDK.
911
module BasePage
1012
# rubocop:disable Lint/UnusedMethodArgument
1113

14+
# @api public
15+
#
1216
# @return [Boolean]
1317
def next_page? = (raise NotImplementedError)
1418

19+
# @api public
20+
#
1521
# @raise [Orb::Errors::APIError]
1622
# @return [Orb::Internal::Type::BasePage]
1723
def next_page = (raise NotImplementedError)
1824

25+
# @api public
26+
#
1927
# @param blk [Proc]
2028
#
2129
# @yieldparam [generic<Elem>]

lib/orb/internal/type/boolean.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ class Boolean
1313

1414
private_class_method :new
1515

16+
# @api public
17+
#
1618
# @param other [Object]
1719
#
1820
# @return [Boolean]
1921
def self.===(other) = other == true || other == false
2022

23+
# @api public
24+
#
2125
# @param other [Object]
2226
#
2327
# @return [Boolean]

lib/orb/internal/type/enum.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ module Enum
4444
# @return [Array<NilClass, Boolean, Integer, Float, Symbol>]
4545
def values = constants.map { const_get(_1) }
4646

47+
# @api public
48+
#
4749
# @param other [Object]
4850
#
4951
# @return [Boolean]
5052
def ===(other) = values.include?(other)
5153

54+
# @api public
55+
#
5256
# @param other [Object]
5357
#
5458
# @return [Boolean]
@@ -58,6 +62,8 @@ def ==(other)
5862
# rubocop:enable Style/CaseEquality
5963
end
6064

65+
# @api public
66+
#
6167
# @return [Integer]
6268
def hash = values.to_set.hash
6369

lib/orb/internal/type/hash_of.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class HashOf
3030
# @option spec [Boolean] :"nil?"
3131
def self.[](...) = new(...)
3232

33+
# @api public
34+
#
3335
# @param other [Object]
3436
#
3537
# @return [Boolean]
@@ -50,6 +52,8 @@ def ===(other)
5052
end
5153
end
5254

55+
# @api public
56+
#
5357
# @param other [Object]
5458
#
5559
# @return [Boolean]
@@ -59,6 +63,8 @@ def ==(other)
5963
# rubocop:enable Layout/LineLength
6064
end
6165

66+
# @api public
67+
#
6268
# @return [Integer]
6369
def hash = [self.class, item_type].hash
6470

lib/orb/internal/type/io_like.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class IOLike
1313

1414
private_class_method :new
1515

16+
# @api public
17+
#
1618
# @param other [Object]
1719
#
1820
# @return [Boolean]
@@ -25,6 +27,8 @@ def self.===(other)
2527
end
2628
end
2729

30+
# @api public
31+
#
2832
# @param other [Object]
2933
#
3034
# @return [Boolean]

0 commit comments

Comments
 (0)