Sha256: fef14b14ddb2edb6365a054b98b285365bd1bdff9053f02cca967fbced8aa73a

Contents?: true

Size: 318 Bytes

Versions: 1

Compression:

Stored size: 318 Bytes

Contents

module Erlectricity
class TypeCondition < Condition
  attr_accessor :type
  
  def initialize(type, name=nil)
    self.type = type
    super(name)
  end
  
  def satisfies?(arg)
    arg.is_a? self.type
  end
  
  def bindings_for(arg)
    return {} unless self.binding_name
    {self.binding_name => arg}
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erlectricity-0.1.0 lib/erlectricity/conditions/type.rb