usr bin ruby1 -KU class Logoped attr_accessor target attr_reader tasks

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/ruby1.9 -KU
class Logoped
attr_accessor :target
attr_reader :tasks
class Task
def initialize
@actions = []
self
end
def add(action, wrong, right)
puts "Action \"#{action}\" (#{wrong} -> #{right}) queued."
@actions.push([action, wrong, right])
self
end
end
def initialize(type)
@type = type
@tasks = Task.new
self
end
def to_s
"Logoped of #{@type} type."
end
def summon
puts "Logoped of #{@type} type summoned. Target is #{@target}!"
self
end
end
mylogo = Logoped.new("strict")
mylogo.target = "Username"
mylogo.tasks.add("replace", "librarys", "libraries")
mylogo.summon