File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ def call(**args)
4343 when "starts_with?"
4444 sig ( args ) { String }
4545 code_starts_with? ( code_value )
46+ when "start_with?"
47+ sig ( args ) { String }
48+ code_start_with? ( code_value )
49+ when "ends_with?"
50+ sig ( args ) { String }
51+ code_ends_with? ( code_value )
52+ when "end_with?"
53+ sig ( args ) { String }
54+ code_end_with? ( code_value )
4655 when "first"
4756 sig ( args ) { Integer . maybe }
4857 code_first ( code_value )
@@ -95,6 +104,19 @@ def code_starts_with?(value)
95104 Boolean . new ( raw . start_with? ( code_value . raw ) )
96105 end
97106
107+ def code_start_with? ( value )
108+ code_starts_with? ( value )
109+ end
110+
111+ def code_end_with? ( value )
112+ code_value = value . to_code
113+ Boolean . new ( raw . end_with? ( code_value . raw ) )
114+ end
115+
116+ def code_ends_with? ( value )
117+ code_end_with? ( value )
118+ end
119+
98120 def code_plus ( other )
99121 code_other = other . to_code
100122 String . new ( raw + code_other . to_s )
Original file line number Diff line number Diff line change 190190 %w[ 9975×14÷8 17456.25 ] ,
191191 %w[ "Hello".starts_with?("He") true ] ,
192192 %w[ "Hello".starts_with?("lo") false ] ,
193+ %w[ "Hello".start_with?("He") true ] ,
194+ %w[ "Hello".start_with?("lo") false ] ,
195+ %w[ "Hello".ends_with?("lo") true ] ,
196+ %w[ "Hello".ends_with?("He") false ] ,
197+ %w[ "Hello".end_with?("lo") true ] ,
198+ %w[ "Hello".end_with?("He") false ] ,
193199 %w[ :Hello.include?(:H) true ] ,
194200 %w[ :admin? :admin? ] ,
195201 %w[ :hello :hello ] ,
You can’t perform that action at this time.
0 commit comments