Module: Typ

Defined in:
lib/typ.rb

Defined Under Namespace

Modules: DSL, Is, IsA

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failsObject (readonly)

Returns the value of attribute fails.



12
13
14
# File 'lib/typ.rb', line 12

def fails
  @fails
end

#gatesObject (readonly)

Returns the value of attribute gates.



12
13
14
# File 'lib/typ.rb', line 12

def gates
  @gates
end

#itObject (readonly)

Returns the value of attribute it.



12
13
14
# File 'lib/typ.rb', line 12

def it
  @it
end

Class Method Details

.included(mod) ⇒ Object



2
3
4
# File 'lib/typ.rb', line 2

def self.included mod
  mod.extend DSL
end

Instance Method Details

#initialize(it) ⇒ Object



6
7
8
9
10
# File 'lib/typ.rb', line 6

def initialize it
  @it = it
  @gates = self.class.gates.map { |gate| gate.new it }
  @fails = gates.reject &:ok?
end

#ok?Boolean



14
15
16
# File 'lib/typ.rb', line 14

def ok?
  fails.empty?
end