Sha256: 766f36707702047e9653f3e7efeedaf00a4a801934c86a03063f9cfe87d12207

Contents?: true

Size: 703 Bytes

Versions: 59

Compression:

Stored size: 703 Bytes

Contents

class Array
    def execute value=nil
      i=0
      while i < self.length
        self[i]=Command.new(self[i]) if(self[i].is_a?(String))
        self[i]=Command.new(self[i]) if(self[i].is_a?(Hash) && !self[i].is_a?(Command))

        if(!value.nil? && value.is_a?(Hash))
          value.each{|k,v|self[i][k]=v}
        end

        self[i].execute if(self[i].is_a?(Command))
        i=i+1
      end
    end

    def add command
      self << command if(!include?(command))
    end

    def to_html
      html=Array.new
      html << '<div>'
      self.each{|e|
        html << e.to_html if e.respond_to?(:to_html)
      }
      html << '</div>'
      html.join
    end
end

Version data entries

59 entries across 59 versions & 2 rubygems

Version Path
dev-2.0.149 lib/base/array.rb
dev-2.0.148 lib/base/array.rb
dev-2.0.147 lib/base/array.rb
dev-2.0.146 lib/base/array.rb
dev-2.0.145 lib/base/array.rb
dev-2.0.143 lib/base/array.rb
dev-2.0.142 lib/array.rb
dev-2.0.141 lib/array.rb
dev-2.0.140 lib/array.rb
dev-2.0.139 lib/commands/array.rb
dev-2.0.138 lib/commands/array.rb
dev-2.0.137 lib/commands/array.rb
dev-2.0.136 lib/commands/array.rb
dev-2.0.135 lib/commands/array.rb
dev-2.0.134 lib/commands/array.rb
dev-2.0.133 lib/commands/array.rb
dev-2.0.132 lib/commands/array.rb
dev-2.0.131 lib/commands/array.rb
dev-2.0.130 lib/commands/array.rb
dev-2.0.129 lib/commands/array.rb