Time remaining:
Ruby programming question

Computer Science
Tutor: None Selected Time limit: 1 Day

write a class, this class in ruby like this:

when you create a object of this class, it will take a pair of chars as surrounding chars and any number of strings. it will put the surrounding chars to each string. and safe the result in a string as the state of the object.

for example, assuming the name of this class is Enclose,

then you can create an object of this class and provide surrounding chars like this:

obj = Enclose.new(“<“, “>”, “i”, “love”, “you”)

then the object will hold an instance variable (array) with this value:

["", "", ""]

you can also reset the instance variable by calling

obj.set(“<“, “>”, “i”, “love”, “you”, “very”, “much”)

then the object will hold an instance variable with this value:

["", "", “”, “, “”]

then add an singleton method to this object, the method will reverse the order of the instance variable

Apr 26th, 2015

sfasfsadfdsafsdafasdfsadfasdfdsafsdaf

Apr 28th, 2015

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Apr 26th, 2015
...
Apr 26th, 2015
Dec 3rd, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer