class Complicated

> '{:filter=>

       {:During=>#<Set: {"1", "2", 
               {:fuck=>#<Set: {"test"}>}}>}, 
:offering=>#<Set: {"1", "2", "3", "4"}>}'

Public Instance Methods

assigns(task) click to toggle source
# File lib/employees/mankind/complicated.rb, line 38
def assigns(task)
        report = ""
        task.each do |subordinate, subtask|
                subordinate = eval( capitalize(subordinate.to_s) + ".new")
                report += subordinate.do plan(subtask)
        end
        report
end
checkAttributesIn(task) click to toggle source
# File lib/employees/mankind/complicated.rb, line 21
def checkAttributesIn(task)
        unless task[:attributes].nil?
                attributes task[:attributes] 
                task.delete :attributes
        end
end
custom(value) click to toggle source
# File lib/employees/mankind/complicated.rb, line 51
def custom(value)
        value.to_s
end
do(tasks) click to toggle source
# File lib/employees/mankind/complicated.rb, line 9
def do(tasks)
        result = plan(tasks).map do |task|
                            if typeOf task, is: Hash
                                    checkAttributesIn task
                                        next assigns task
                                end
                                next self.do task if typeOf task, is: Array
                                next task if typeOf task, is: String
                         end
        report result
end
plan(task) click to toggle source
# File lib/employees/mankind/complicated.rb, line 32
def plan(task)
        return task.to_a if typeOf task, is: Set
        return task if typeOf task, is: Array
        [task]
end
report(result) click to toggle source
# File lib/employees/mankind/complicated.rb, line 28
def report(result)
        result.map { |task| tag task }.join " "
end
tag(value=nil, attrs={}) click to toggle source
# File lib/employees/mankind/complicated.rb, line 47
def tag(value=nil, attrs={})
        "<#{namespace}#{tag_name}#{@attributes}> #{custom value}</#{namespace}#{tag_name}> "
end