Class: Erlectricity::TypeCondition

Inherits:
Condition
  • Object
show all
Defined in:
lib/erlectricity/conditions/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Condition

for

Constructor Details

#initialize(type) ⇒ TypeCondition

Returns a new instance of TypeCondition.



5
6
7
# File 'lib/erlectricity/conditions/type.rb', line 5

def initialize(type)
  self.type = type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/erlectricity/conditions/type.rb', line 3

def type
  @type
end

Instance Method Details

#binding_for(arg) ⇒ Object



13
14
15
# File 'lib/erlectricity/conditions/type.rb', line 13

def binding_for(arg)
  arg
end

#satisfies?(arg) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/erlectricity/conditions/type.rb', line 9

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