Class: Tensai::Logic::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/tensai/logic/entity.rb

Overview

Logical entity which appears in predicates

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_subtype(name) ⇒ Object

Create a subtype with the specified name



32
33
34
35
36
# File 'lib/tensai/logic/entity.rb', line 32

def create_subtype(name)
  Class.new(self) do
    @name = Dry::Inflector.new.classify(name.to_s)
  end
end

.nameObject

Name of entity class



25
26
27
# File 'lib/tensai/logic/entity.rb', line 25

def name
  @name || 'Entity'
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/tensai/logic/entity.rb', line 17

def inspect
  "#{self.class.name}(#{name})"
end