Skip to content

Commit e7811f9

Browse files
committed
Small cleanup of stringio.rb
1 parent 34a7a91 commit e7811f9

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

lib/truffle/stringio.rb

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,15 @@ def initialize_copy(from)
103103
self
104104
end
105105

106-
def check_readable
106+
private def check_readable
107107
raise IOError, 'not opened for reading' unless @readable
108108
end
109109

110-
private :check_readable
111-
112-
def check_writable
110+
private def check_writable
113111
raise IOError, 'not opened for writing' unless @writable
114112
raise IOError, 'unable to modify data' if @__data__.string.frozen?
115113
end
116114

117-
private :check_writable
118-
119115
def set_encoding(external, internal=nil, options=nil)
120116
encoding = external || Encoding.default_external
121117
@__data__.encoding = encoding
@@ -147,7 +143,6 @@ def each_byte
147143

148144
self
149145
end
150-
151146
alias_method :bytes, :each_byte
152147

153148
def each_char
@@ -158,7 +153,6 @@ def each_char
158153

159154
self
160155
end
161-
162156
alias_method :chars, :each_char
163157

164158
def each_codepoint(&block)
@@ -181,7 +175,6 @@ def each_codepoint(&block)
181175

182176
self
183177
end
184-
185178
alias_method :codepoints, :each_codepoint
186179

187180
def each(sep=$/, limit=Undefined)
@@ -662,9 +655,7 @@ def yaml_initialize(type, val)
662655
@__data__ = Data.new('')
663656
end
664657

665-
protected
666-
667-
def mode_from_string(mode)
658+
private def mode_from_string(mode)
668659
@append = truncate = false
669660

670661
if mode[0] == ?r
@@ -687,7 +678,7 @@ def mode_from_string(mode)
687678
d.string.replace('') if truncate
688679
end
689680

690-
def mode_from_integer(mode)
681+
private def mode_from_integer(mode)
691682
@readable = @writable = @append = false
692683
d = @__data__
693684

@@ -704,7 +695,7 @@ def mode_from_integer(mode)
704695
d.string.replace('') if (mode & IO::TRUNC) != 0
705696
end
706697

707-
def getline(arg_error, sep, limit)
698+
private def getline(arg_error, sep, limit)
708699
if limit != Undefined
709700
limit = Truffle::Type.coerce_to_int limit if limit
710701
sep = Truffle::Type.coerce_to sep, String, :to_str if sep

0 commit comments

Comments
 (0)