Sha256: 90f9cc0b438a752681e329cdf0e732e97d96c7bbd89d2a5c8c1496b202937c24

Contents?: true

Size: 248 Bytes

Versions: 8

Compression:

Stored size: 248 Bytes

Contents

module Erlectricity
  class TypeCondition < Condition
    attr_accessor :type

    def initialize(type)
      self.type = type
    end

    def satisfies?(arg)
      arg.is_a?(self.type)
    end

    def binding_for(arg)
      arg
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
mojombo-erlectricity-1.0.0 lib/erlectricity/conditions/type.rb
mojombo-erlectricity-1.0.1 lib/erlectricity/conditions/type.rb
mojombo-erlectricity-1.0.2 lib/erlectricity/conditions/type.rb
erlectricity-funbox-1.1.2 lib/erlectricity/conditions/type.rb
erlectricity-1.1.1 lib/erlectricity/conditions/type.rb
erlectricity-1.1.0 lib/erlectricity/conditions/type.rb
erlectricity-1.0.0 lib/erlectricity/conditions/type.rb
erlectricity-1.0.1 lib/erlectricity/conditions/type.rb