@@ -103,19 +103,15 @@ def initialize_copy(from)
103
103
self
104
104
end
105
105
106
- def check_readable
106
+ private def check_readable
107
107
raise IOError , 'not opened for reading' unless @readable
108
108
end
109
109
110
- private :check_readable
111
-
112
- def check_writable
110
+ private def check_writable
113
111
raise IOError , 'not opened for writing' unless @writable
114
112
raise IOError , 'unable to modify data' if @__data__ . string . frozen?
115
113
end
116
114
117
- private :check_writable
118
-
119
115
def set_encoding ( external , internal = nil , options = nil )
120
116
encoding = external || Encoding . default_external
121
117
@__data__ . encoding = encoding
@@ -147,7 +143,6 @@ def each_byte
147
143
148
144
self
149
145
end
150
-
151
146
alias_method :bytes , :each_byte
152
147
153
148
def each_char
@@ -158,7 +153,6 @@ def each_char
158
153
159
154
self
160
155
end
161
-
162
156
alias_method :chars , :each_char
163
157
164
158
def each_codepoint ( &block )
@@ -181,7 +175,6 @@ def each_codepoint(&block)
181
175
182
176
self
183
177
end
184
-
185
178
alias_method :codepoints , :each_codepoint
186
179
187
180
def each ( sep = $/, limit = Undefined )
@@ -662,9 +655,7 @@ def yaml_initialize(type, val)
662
655
@__data__ = Data . new ( '' )
663
656
end
664
657
665
- protected
666
-
667
- def mode_from_string ( mode )
658
+ private def mode_from_string ( mode )
668
659
@append = truncate = false
669
660
670
661
if mode [ 0 ] == ?r
@@ -687,7 +678,7 @@ def mode_from_string(mode)
687
678
d . string . replace ( '' ) if truncate
688
679
end
689
680
690
- def mode_from_integer ( mode )
681
+ private def mode_from_integer ( mode )
691
682
@readable = @writable = @append = false
692
683
d = @__data__
693
684
@@ -704,7 +695,7 @@ def mode_from_integer(mode)
704
695
d . string . replace ( '' ) if ( mode & IO ::TRUNC ) != 0
705
696
end
706
697
707
- def getline ( arg_error , sep , limit )
698
+ private def getline ( arg_error , sep , limit )
708
699
if limit != Undefined
709
700
limit = Truffle ::Type . coerce_to_int limit if limit
710
701
sep = Truffle ::Type . coerce_to sep , String , :to_str if sep
0 commit comments