Skip to content

Commit

Permalink
Add back union and structure sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Aug 22, 2023
1 parent 79a4298 commit 6c48d1b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hearth/sig/lib/hearth/structure.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Hearth
# A module mixed into Structs that provides utility methods.
module Structure
# Deeply converts the Struct into a hash. Structure members that
# are `nil` are omitted from the resultant hash.
#
# @return [Hash]
def to_h: (?untyped obj) -> untyped

alias to_hash to_h

private

def _to_h_struct: (untyped obj) -> untyped

def _to_h_hash: (untyped obj) -> untyped
end
end
6 changes: 6 additions & 0 deletions hearth/sig/lib/hearth/union.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Hearth
# Top level class for all Union types
class Union < ::SimpleDelegator
include Hearth::Structure
end
end

0 comments on commit 6c48d1b

Please sign in to comment.