Module: Typ::IsA
- Defined in:
- lib/typ.rb
Defined Under Namespace
Modules: Singleton
Instance Attribute Summary collapse
-
#it ⇒ Object
readonly
Returns the value of attribute it.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#it ⇒ Object (readonly)
Returns the value of attribute it.
121 122 123 |
# File 'lib/typ.rb', line 121 def it @it end |
Class Method Details
.included(gate) ⇒ Object
104 105 106 |
# File 'lib/typ.rb', line 104 def self.included gate gate.extend Singleton end |
.new(type) ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'lib/typ.rb', line 94 def new type check = -> it { it.is_a? type } gate = Class.new gate.include self gate.check = check gate end |
Instance Method Details
#initialize(it) ⇒ Object
116 117 118 119 |
# File 'lib/typ.rb', line 116 def initialize it @it = it @ok = self.class.check[it] end |
#ok? ⇒ Boolean
112 113 114 |
# File 'lib/typ.rb', line 112 def ok? @ok end |