X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=lib%2Foperator.rb;h=a0104fb4bc831654038520b047f19337068d3169;hb=d8ecc09d2b43654df977f63e26b9ef6bb233e74d;hp=316bcbb6681362f1f10b2292e25a897efffea207;hpb=a932d128294165749ee3c60667077b1c1463db56;p=pettanr%2Fpettanr.git diff --git a/lib/operator.rb b/lib/operator.rb index 316bcbb6..a0104fb4 100644 --- a/lib/operator.rb +++ b/lib/operator.rb @@ -7,6 +7,15 @@ class Operator end #InstanceMethods + def find_user + @operators.each do |operator| + return operator if operator.is_a?(User) + return operator.user if operator.is_a?(Author) + return operator.user if operator.is_a?(Artist) + end + nil + end + def find_author @operators.each do |operator| return operator if operator.is_a?(Author) @@ -32,6 +41,11 @@ class Operator nil end + def user + return @user if @user + @user = find_user + end + def author return @author if @author @author = find_author