Skip to content

Commit

Permalink
Add examples/example-converted.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoasleep committed May 16, 2024
1 parent 0e1a9be commit c97548a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/example-converted.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# rbs_inline: enabled

class Code
# @return [String]
attr_reader :source #:: String

# @param source [String]
#:: (String source) -> untyped
def initialize(source)
@source = source
end

# @param new_source [String]
# @return [Code]
#:: (String new_source) -> Code
def rewrite(new_source)
@source = new_source

self
end

# @param recover [Boolean].
# @return [Array<Token>]
#:: (?recover: bool) -> Array[Token]
def tokenize(recover: false)
parser.tokenize(source, recover: recover)
end
end

0 comments on commit c97548a

Please sign in to comment.