Class: Kind::Object::Instance

Inherits:
Object
  • Object
show all
Includes:
Kind::Object
Defined in:
lib/kind/objects/object.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Kind::Object

#===, #inspect

Methods included from UnionType::Buildable

#|

Methods included from Maybe::Buildable

#maybe

Methods included from BasicObject

#[], #or, #or_nil, #or_null, #or_undefined, #value, #value?

Constructor Details

#initialize(kind, opt) ⇒ Instance

Returns a new instance of Instance.



34
35
36
37
38
39
# File 'lib/kind/objects/object.rb', line 34

def initialize(kind, opt)
  name = ResolveKindName.(kind, opt)

  @name = STRICT.kind_of(::String, name)
  @kind = KIND.respond_to!(:===, kind)
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



32
33
34
# File 'lib/kind/objects/object.rb', line 32

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.



32
33
34
# File 'lib/kind/objects/object.rb', line 32

def name
  @name
end