Class: Literal::Types::ClassType
- Inherits:
-
Object
- Object
- Literal::Types::ClassType
- Defined in:
- lib/literal/types/class_type.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(type) ⇒ ClassType
constructor
A new instance of ClassType.
- #inspect ⇒ Object
Constructor Details
#initialize(type) ⇒ ClassType
Returns a new instance of ClassType.
2 3 4 |
# File 'lib/literal/types/class_type.rb', line 2 def initialize(type) @type = type end |
Instance Method Details
#===(value) ⇒ Object
10 11 12 |
# File 'lib/literal/types/class_type.rb', line 10 def ===(value) value.is_a?(::Class) && (value == @type || value < @type) end |
#inspect ⇒ Object
6 7 8 |
# File 'lib/literal/types/class_type.rb', line 6 def inspect "Class(#{@type.name})" end |