Sha256: 8684b1efa26269312165e0e99ec4faed415b36ad8c21c80a2eba63759fb564ed

Contents?: true

Size: 739 Bytes

Versions: 118

Compression:

Stored size: 739 Bytes

Contents

puts __FILE__ if defined?(DEBUG)

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

118 entries across 118 versions & 1 rubygems

Version Path
dev-2.0.268 lib/base/array.rb
dev-2.0.267 lib/base/array.rb
dev-2.0.266 lib/base/array.rb
dev-2.0.265 lib/base/array.rb
dev-2.0.264 lib/base/array.rb
dev-2.0.263 lib/base/array.rb
dev-2.0.262 lib/base/array.rb
dev-2.0.261 lib/base/array.rb
dev-2.0.260 lib/base/array.rb
dev-2.0.259 lib/base/array.rb
dev-2.0.258 lib/base/array.rb
dev-2.0.257 lib/base/array.rb
dev-2.0.256 lib/base/array.rb
dev-2.0.255 lib/base/array.rb
dev-2.0.254 lib/base/array.rb
dev-2.0.253 lib/base/array.rb
dev-2.0.252 lib/base/array.rb
dev-2.0.251 lib/base/array.rb
dev-2.0.250 lib/base/array.rb
dev-2.0.249 lib/base/array.rb