Class: Literal::Types::KindType

Inherits:
Object
  • Object
show all
Includes:
Literal::Type
Defined in:
lib/literal/types/kind_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Literal::Type

#<=, #>=

Constructor Details

#initialize(type) ⇒ KindType

Returns a new instance of KindType.



6
7
8
9
# File 'lib/literal/types/kind_type.rb', line 6

def initialize(type)
  @type = type
  freeze
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/literal/types/kind_type.rb', line 11

def type
  @type
end

Instance Method Details

#===(object) ⇒ Object



13
14
15
# File 'lib/literal/types/kind_type.rb', line 13

def ===(object)
  Literal.subtype?(object, @type)
end