Sha256: c0bb73ea486df569db3c6c985d02be5fdc235ad55a4423bac9667bf5871b6f61

Contents?: true

Size: 565 Bytes

Versions: 21

Compression:

Stored size: 565 Bytes

Contents

class Array
    def execute
      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))
        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

21 entries across 21 versions & 1 rubygems

Version Path
dev_commands-0.0.46 lib/array.rb
dev_commands-0.0.45 lib/array.rb
dev_commands-0.0.44 lib/array.rb
dev_commands-0.0.43 lib/array.rb
dev_commands-0.0.42 lib/array.rb
dev_commands-0.0.39 lib/array.rb
dev_commands-0.0.38 lib/array.rb
dev_commands-0.0.37 lib/array.rb
dev_commands-0.0.36 lib/array.rb
dev_commands-0.0.35 lib/array.rb
dev_commands-0.0.34 lib/array.rb
dev_commands-0.0.25 lib/array.rb
dev_commands-0.0.24 lib/array.rb
dev_commands-0.0.23 lib/array.rb
dev_commands-0.0.17 lib/array.rb
dev_commands-0.0.16 lib/array.rb
dev_commands-0.0.15 lib/array.rb
dev_commands-0.0.14 lib/array.rb
dev_commands-0.0.13 lib/array.rb
dev_commands-0.0.12 lib/array.rb