WpItem::Findable#Found_From= specs

This commit is contained in:
erwanlr
2013-03-25 13:53:36 +01:00
parent 6f49584546
commit 2ee2fe494d
3 changed files with 26 additions and 3 deletions

View File

@@ -3,10 +3,9 @@
class WpItem
attr_reader :found_from
#def allowed_options; super << :found_from end
def found_from=(method)
@found_from = method[%r{find_from_(.*)}, 1].gsub('_', ' ')
found = method[%r{find_from_(.*)}, 1]
@found_from = found.gsub('_', ' ') if found
end
module Findable