Time remaining:

Ruby programming question


label Computer Science
account_circle Unassigned
schedule 1 Day
account_balance_wallet $5

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

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Apr 26th, 2015
...
Apr 26th, 2015
Nov 21st, 2017
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