Sha256: ee3710ec13a071fa52a2376b1056e5a41c49356e0effc0f4c4ae30aa7d4c6272

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

module Relevance
  module Tarantula

    class Attack
      HASHABLE_ATTRS = [:name, :input, :output, :description]
      attr_accessor *HASHABLE_ATTRS
      def initialize(hash)
        hash.each do |k,v|
          raise ArgumentError, k unless HASHABLE_ATTRS.member?(k)
          self.instance_variable_set("@#{k}", v)
        end
      end
      def ==(other)
        Relevance::Tarantula::Attack === other && HASHABLE_ATTRS.all? { |attr| send(attr) == other.send(attr)}
      end
      def input(input_field=nil)
        @input
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
codez-tarantula-0.5.5 lib/relevance/tarantula/attack.rb
codez-tarantula-0.5.4 lib/relevance/tarantula/attack.rb
codez-tarantula-0.5.3 lib/relevance/tarantula/attack.rb
codez-tarantula-0.5.1 lib/relevance/tarantula/attack.rb
codez-tarantula-0.5.0 lib/relevance/tarantula/attack.rb
tarantula-0.5.1 lib/relevance/tarantula/attack.rb
tarantula-0.5.0 lib/relevance/tarantula/attack.rb
tarantula-0.4.3 lib/relevance/tarantula/attack.rb
tarantula-0.4.2 lib/relevance/tarantula/attack.rb
tarantula-0.4.1 lib/relevance/tarantula/attack.rb
tarantula-0.4.0 lib/relevance/tarantula/attack.rb