Class: Atomy::Pattern::KindOf
- Inherits:
-
Atomy::Pattern
- Object
- Atomy::Pattern
- Atomy::Pattern::KindOf
- Defined in:
- lib/atomy/pattern/kind_of.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Attributes inherited from Atomy::Pattern
Instance Method Summary collapse
-
#initialize(klass) ⇒ KindOf
constructor
A new instance of KindOf.
- #matches?(val) ⇒ Boolean
- #target ⇒ Object
Methods inherited from Atomy::Pattern
Constructor Details
#initialize(klass) ⇒ KindOf
Returns a new instance of KindOf.
8 9 10 |
# File 'lib/atomy/pattern/kind_of.rb', line 8 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
6 7 8 |
# File 'lib/atomy/pattern/kind_of.rb', line 6 def klass @klass end |
Instance Method Details
#matches?(val) ⇒ Boolean
12 13 14 |
# File 'lib/atomy/pattern/kind_of.rb', line 12 def matches?(val) val.kind_of?(@klass) end |
#target ⇒ Object
16 17 18 |
# File 'lib/atomy/pattern/kind_of.rb', line 16 def target @klass end |