Module: Typ
- Defined in:
- lib/typ.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#fails ⇒ Object
readonly
Returns the value of attribute fails.
-
#gates ⇒ Object
readonly
Returns the value of attribute gates.
-
#it ⇒ Object
readonly
Returns the value of attribute it.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#fails ⇒ Object (readonly)
Returns the value of attribute fails.
12 13 14 |
# File 'lib/typ.rb', line 12 def fails @fails end |
#gates ⇒ Object (readonly)
Returns the value of attribute gates.
12 13 14 |
# File 'lib/typ.rb', line 12 def gates @gates end |
#it ⇒ Object (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 |